Skip to content

Commit 3c94a37

Browse files
bennypowersmmstick
authored andcommitted
feat: active-hint-border-radius
1 parent 4c03091 commit 3c94a37

File tree

7 files changed

+40
-7
lines changed

7 files changed

+40
-7
lines changed

dark.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.pop-shell-active-hint {
22
border-style: solid;
33
border-color: #FBB86C;
4-
border-radius: 5px;
4+
border-radius: var(--active-hint-border-radius, 5px);
55
box-shadow: inset 0 0 0 1px rgba(24, 23, 23, 0)
66
}
77

highcontrast.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.pop-shell-active-hint {
22
border-style: solid;
33
border-color: #FBB86C;
4-
border-radius: 5px;
4+
border-radius: var(--active-hint-border-radius, 5px);
55
box-shadow: inset 0 0 0 1px rgba(24, 23, 23, 0)
66
}
77

@@ -58,4 +58,4 @@
5858

5959
.pop-shell-entry:indeterminate {
6060
font-style: italic
61-
}
61+
}

light.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.pop-shell-active-hint {
22
border-style: solid;
33
border-color: #FFAD00;
4-
border-radius: 5px;
4+
border-radius: var(--active-hint-border-radius, 5px);
55
box-shadow: inset 0 0 0 1px rgba(200, 200, 200, 0);
66
}
77

schemas/org.gnome.shell.extensions.pop-shell.gschema.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
<summary>Show a hint around the active window</summary>
88
</key>
99

10+
<key type="u" name="active-hint-border-radius">
11+
<default>5</default>
12+
<summary>Border radius for active window hint, in pixels</summary>
13+
</key>
14+
1015
<key type="b" name="fullscreen-launcher">
1116
<default>false</default>
1217
<summary>Allow showing launcher above fullscreen windows</summary>

src/panel_settings.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class Indicator {
1616
toggle_tiled : any
1717
toggle_titles: null | any
1818
toggle_active: any
19+
border_radius: any
1920

2021
entry_gaps: any
2122

@@ -64,6 +65,14 @@ export class Indicator {
6465
}
6566
)
6667

68+
this.border_radius = number_entry(
69+
_("Active Border Radius"),
70+
ext.settings.active_hint_border_radius(),
71+
(value) => {
72+
ext.settings.set_active_hint_border_radius(value);
73+
}
74+
)
75+
6776
bm.addMenuItem(this.toggle_tiled);
6877
bm.addMenuItem(floating_window_exceptions(ext, bm));
6978

@@ -78,6 +87,7 @@ export class Indicator {
7887
}
7988

8089
bm.addMenuItem(this.toggle_active);
90+
bm.addMenuItem(this.border_radius);
8191

8292
// CSS Selector
8393
bm.addMenuItem(color_selector(ext, bm),);
@@ -345,4 +355,4 @@ function color_selector(ext: Ext, menu: any) {
345355
});
346356

347357
return color_selector_item;
348-
}
358+
}

src/settings.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function settings_new_schema(schema: string): Settings {
4848
}
4949

5050
const ACTIVE_HINT = "active-hint";
51+
const ACTIVE_HINT_BORDER_RADIUS = "active-hint-border-radius";
5152
const COLUMN_SIZE = "column-size";
5253
const EDGE_TILING = "edge-tiling";
5354
const FULLSCREEN_LAUNCHER = "fullscreen-launcher"
@@ -76,6 +77,10 @@ export class ExtensionSettings {
7677
return this.ext.get_boolean(ACTIVE_HINT);
7778
}
7879

80+
active_hint_border_radius(): number {
81+
return this.ext.get_uint(ACTIVE_HINT_BORDER_RADIUS);
82+
}
83+
7984
column_size(): number {
8085
return this.ext.get_uint(COLUMN_SIZE);
8186
}
@@ -168,6 +173,10 @@ export class ExtensionSettings {
168173
this.ext.set_boolean(ACTIVE_HINT, set);
169174
}
170175

176+
set_active_hint_border_radius(set: number) {
177+
this.ext.set_uint(ACTIVE_HINT_BORDER_RADIUS, set);
178+
}
179+
171180
set_column_size(size: number) {
172181
this.ext.set_uint(COLUMN_SIZE, size);
173182
}

src/window.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ export class ShellWindow {
189189
this.ext.overlay.set_style(`background: ${gdk.to_string()}`);
190190
}
191191

192-
if (this.border)
193-
this.border.set_style(`border-color: ${color_value}`);
192+
this.update_border_style()
194193
}
195194

196195
cmdline(): string | null {
@@ -418,6 +417,7 @@ export class ShellWindow {
418417
if (!this.border) return
419418

420419
this.restack();
420+
this.update_border_style();
421421
if (this.ext.settings.active_hint()) {
422422
let border = this.border;
423423

@@ -627,6 +627,15 @@ export class ShellWindow {
627627
}
628628
}
629629

630+
update_border_style() {
631+
const { settings } = this.ext
632+
const color_value = settings.hint_color_rgba();
633+
const radius_value = settings.active_hint_border_radius();
634+
if (this.border) {
635+
this.border.set_style(`border-color: ${color_value}; border-radius: ${radius_value}px;`);
636+
}
637+
}
638+
630639
private wm_class_changed() {
631640
if (this.is_tilable(this.ext)) {
632641
this.ext.connect_window(this);

0 commit comments

Comments
 (0)