Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow active hint border width changes #1641

Open
wants to merge 2 commits into
base: master_jammy
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}

.pop-shell-border-normal {
border-width: 3px;
border-width: var(--active-hint-border-width, 3px);
}

.pop-shell-border-maximize {
Expand Down
2 changes: 1 addition & 1 deletion highcontrast.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}

.pop-shell-border-normal {
border-width: 3px;
border-width: var(--active-hint-border-width, 3px);
}

.pop-shell-border-maximize {
Expand Down
2 changes: 1 addition & 1 deletion light.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}

.pop-shell-border-normal {
border-width: 3px;
border-width: var(--active-hint-border-width, 3px);
}

.pop-shell-border-maximize {
Expand Down
6 changes: 6 additions & 0 deletions schemas/org.gnome.shell.extensions.pop-shell.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
<summary>Border radius for active window hint, in pixels</summary>
</key>

<key type="u" name="active-hint-border-width">
<default>3</default>
<range min="1" max="15"/>
<summary>Border width for active window hint, in pixels</summary>
</key>

<key type="b" name="fullscreen-launcher">
<default>false</default>
<summary>Allow showing launcher above fullscreen windows</summary>
Expand Down
14 changes: 14 additions & 0 deletions src/panel_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class Indicator {
toggle_titles: null | any
toggle_active: any
border_radius: any
border_width: any

entry_gaps: any

Expand Down Expand Up @@ -77,6 +78,18 @@ export class Indicator {
}
)

this.border_width = number_entry(
_("Active Border Width"),
{
value: ext.settings.active_hint_border_width(),
min: 1,
max: 15
},
(value) => {
ext.settings.set_active_hint_border_width(value);
}
)

bm.addMenuItem(this.toggle_tiled);
bm.addMenuItem(floating_window_exceptions(ext, bm));

Expand All @@ -92,6 +105,7 @@ export class Indicator {

bm.addMenuItem(this.toggle_active);
bm.addMenuItem(this.border_radius);
bm.addMenuItem(this.border_width);

// CSS Selector
bm.addMenuItem(color_selector(ext, bm),);
Expand Down
9 changes: 9 additions & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function settings_new_schema(schema: string): Settings {

const ACTIVE_HINT = "active-hint";
const ACTIVE_HINT_BORDER_RADIUS = "active-hint-border-radius";
const ACTIVE_HINT_BORDER_WIDTH = "active-hint-border-width";
const STACKING_WITH_MOUSE = "stacking-with-mouse";
const COLUMN_SIZE = "column-size";
const EDGE_TILING = "edge-tiling";
Expand Down Expand Up @@ -83,6 +84,10 @@ export class ExtensionSettings {
return this.ext.get_uint(ACTIVE_HINT_BORDER_RADIUS);
}

active_hint_border_width(): number {
return this.ext.get_uint(ACTIVE_HINT_BORDER_WIDTH);
}

stacking_with_mouse(): boolean {
return this.ext.get_boolean(STACKING_WITH_MOUSE);
}
Expand Down Expand Up @@ -187,6 +192,10 @@ export class ExtensionSettings {
this.ext.set_uint(ACTIVE_HINT_BORDER_RADIUS, set);
}

set_active_hint_border_width(set: number) {
this.ext.set_uint(ACTIVE_HINT_BORDER_WIDTH, set);
}

set_stacking_with_mouse(set: boolean) {
this.ext.set_boolean(STACKING_WITH_MOUSE, set);
}
Expand Down
3 changes: 2 additions & 1 deletion src/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,9 @@ export class ShellWindow {
const { settings } = this.ext
const color_value = settings.hint_color_rgba();
const radius_value = settings.active_hint_border_radius();
const width_value = settings.active_hint_border_width();
if (this.border) {
this.border.set_style(`border-color: ${color_value}; border-radius: ${radius_value}px;`);
this.border.set_style(`border-color: ${color_value}; border-radius: ${radius_value}px; border-width: ${width_value}px;`);
}
}

Expand Down