Skip to content

Commit 8f8b92c

Browse files
Andrew ZaechAndrew Zaech
authored andcommitted
Add check if get_icon() is null. Reset reload-theme to default on start. Set min-width to button styling.
1 parent 9561b83 commit 8f8b92c

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

controller.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ const _ = Gettext.gettext;
3434
var MenuSettingsController = class {
3535
constructor(settings, settingsControllers, panel, panelIndex, arcMenuPlacement) {
3636
this._settings = settings;
37+
if(this._settings.get_boolean('reload-theme'))
38+
this._settings.reset('reload-theme');
3739
this.panel = panel;
3840
this.arcMenuPlacement = arcMenuPlacement;
3941

@@ -150,7 +152,8 @@ var MenuSettingsController = class {
150152

151153
_plasmaMenuReloadExtension(){
152154
if(this._settings.get_enum('menu-layout') === Constants.MENU_LAYOUT.Plasma){
153-
this._settings.reset('reload-theme');
155+
if(this._settings.get_boolean('reload-theme'))
156+
this._settings.reset('reload-theme');
154157
this._settings.set_boolean('reload-theme', true);
155158
}
156159
}

menulayouts/tweaks/tweaks.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ var TweaksDialog = GObject.registerClass(
126126
avatarStyleCombo.set_active(this._settings.get_enum('avatar-style'));
127127
avatarStyleCombo.connect('changed', (widget) => {
128128
this._settings.set_enum('avatar-style', widget.get_active());
129-
this._settings.reset('reload-theme');
130129
this._settings.set_boolean('reload-theme', true);
131130
});
132131
avatarStyleRow.add(avatarStyleLabel);
@@ -256,7 +255,6 @@ var TweaksDialog = GObject.registerClass(
256255
foregroundColorChooser.set_rgba(color);
257256
foregroundColorChooser.connect('color-set', ()=>{
258257
this._settings.set_string('plasma-selected-color', foregroundColorChooser.get_rgba().to_string());
259-
this._settings.reset('reload-theme');
260258
this._settings.set_boolean('reload-theme', true);
261259
});
262260
foregroundColorRow.add(foregroundColorLabel);
@@ -275,7 +273,6 @@ var TweaksDialog = GObject.registerClass(
275273
backgroundColorChooser.set_rgba(color);
276274
backgroundColorChooser.connect('color-set', ()=>{
277275
this._settings.set_string('plasma-selected-background-color',backgroundColorChooser.get_rgba().to_string());
278-
this._settings.reset('reload-theme');
279276
this._settings.set_boolean('reload-theme', true);
280277
});
281278
backgroundColorRow.add(backgroundColorLabel);
@@ -307,7 +304,6 @@ var TweaksDialog = GObject.registerClass(
307304
this._settings.reset('plasma-selected-background-color');
308305
this._settings.reset('plasma-enable-hover');
309306
this._settings.reset('plasma-show-descriptions');
310-
this._settings.reset('reload-theme');
311307
this._settings.set_boolean('reload-theme', true);
312308
});
313309
vbox.add(resetButton);

prefs.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ var MenuSettingsPinnedAppsPage = GObject.registerClass(
160160
}
161161
iconString = frameRow._icon;
162162
if(frameRow._icon === "" && Gio.DesktopAppInfo.new(frameRow._cmd)){
163-
iconString = Gio.DesktopAppInfo.new(frameRow._cmd).get_icon().to_string();
163+
iconString = Gio.DesktopAppInfo.new(frameRow._cmd).get_icon() ? Gio.DesktopAppInfo.new(frameRow._cmd).get_icon().to_string() : "";
164164
}
165165

166166
let arcMenuImage = new Gtk.Image( {
@@ -1928,7 +1928,6 @@ var ButtonAppearancePage = GObject.registerClass(
19281928
resetButton.set_sensitive(true);
19291929
this.menuButtonColor = menuButtonColorChooser.get_rgba().to_string();
19301930
this._settings.set_string('menu-button-color',this.menuButtonColor);
1931-
this._settings.reset('reload-theme');
19321931
this._settings.set_boolean('reload-theme', true);
19331932
});
19341933
let menuButtonColorInfoButton = new PW.InfoButton();
@@ -1962,7 +1961,6 @@ var ButtonAppearancePage = GObject.registerClass(
19621961
resetButton.set_sensitive(true);
19631962
this.menuButtonHoverColor = menuButtonHoverColorChooser.get_rgba().to_string();
19641963
this._settings.set_string('menu-button-hover-color',this.menuButtonHoverColor);
1965-
this._settings.reset('reload-theme');
19661964
this._settings.set_boolean('reload-theme', true);
19671965
});
19681966

@@ -1997,7 +1995,6 @@ var ButtonAppearancePage = GObject.registerClass(
19971995
resetButton.set_sensitive(true);
19981996
this.menuButtonActiveColor = menuButtonActiveColorChooser.get_rgba().to_string();
19991997
this._settings.set_string('menu-button-active-color',this.menuButtonActiveColor);
2000-
this._settings.reset('reload-theme');
20011998
this._settings.set_boolean('reload-theme', true);
20021999
});
20032000

@@ -2032,7 +2029,6 @@ var ButtonAppearancePage = GObject.registerClass(
20322029
resetButton.set_sensitive(true);
20332030
this.menuButtonHoverBackgroundcolor = menuButtonHoverBackgroundcolorChooser.get_rgba().to_string();
20342031
this._settings.set_string('menu-button-hover-backgroundcolor',this.menuButtonHoverBackgroundcolor);
2035-
this._settings.reset('reload-theme');
20362032
this._settings.set_boolean('reload-theme', true);
20372033
});
20382034

@@ -2054,7 +2050,6 @@ var ButtonAppearancePage = GObject.registerClass(
20542050
resetButton.set_sensitive(true);
20552051
this.menuButtonActiveBackgroundcolor = menuButtonActiveBackgroundcolorChooser.get_rgba().to_string();
20562052
this._settings.set_string('menu-button-active-backgroundcolor',this.menuButtonActiveBackgroundcolor);
2057-
this._settings.reset('reload-theme');
20582053
this._settings.set_boolean('reload-theme', true);
20592054
});
20602055

@@ -2094,7 +2089,6 @@ var ButtonAppearancePage = GObject.registerClass(
20942089
this._settings.reset('menu-button-hover-backgroundcolor');
20952090
this._settings.reset('menu-button-active-backgroundcolor');
20962091
this._settings.reset('menu-button-color');
2097-
this._settings.reset('reload-theme');
20982092
this._settings.set_boolean('reload-theme', true);
20992093

21002094
resetButton.set_sensitive(false);
@@ -2453,7 +2447,6 @@ var MenuLayoutPage = GObject.registerClass(
24532447
menuLayoutsBox.connect('menu-layout-response', (dialog, response) => {
24542448
if(response === -10) {
24552449
this._settings.set_enum('menu-layout', dialog.index);
2456-
this._settings.reset('reload-theme');
24572450
this._settings.set_boolean('reload-theme', true);
24582451
currentLayoutBoxLabel.label = this.getMenuLayoutName(dialog.index);
24592452
tweaksLabel.label = currentLayoutBoxLabel.label +" " + _("Tweaks");
@@ -2553,7 +2546,6 @@ var MenuThemePage = GObject.registerClass(
25532546
overrideArcMenuSwitch.set_active(this._settings.get_boolean('enable-custom-arc-menu'));
25542547
overrideArcMenuSwitch.connect('notify::active', (widget) => {
25552548
this._settings.set_boolean('enable-custom-arc-menu',widget.get_active());
2556-
this._settings.reset('reload-theme');
25572549
this._settings.set_boolean('reload-theme', true);
25582550
if(widget.get_active()){
25592551
this.mainBox.add(this.menuThemeCustomizationBox);
@@ -2579,7 +2571,6 @@ var MenuThemePage = GObject.registerClass(
25792571
this._settings.set_int('menu-corner-radius', dialog.cornerRadius);
25802572
this._settings.set_int('menu-margin', dialog.menuMargin);
25812573
this._settings.set_int('menu-arrow-size', dialog.menuArrowSize);
2582-
this._settings.reset('reload-theme');
25832574
this._settings.set_boolean('reload-theme', true);
25842575
this.presetName = dialog.presetName;
25852576
}
@@ -3183,7 +3174,6 @@ var MenuSettingsGeneralPage = GObject.registerClass(
31833174
this._settings.set_boolean('enable-sub-menus', this.subMenus);
31843175
this._settings.set_boolean('disable-recently-installed-apps', this.disableRecentApps);
31853176
this._settings.set_boolean('disable-tooltips', this.disableTooltips);
3186-
this._settings.reset('reload-theme');
31873177
this._settings.set_boolean('reload-theme', true);
31883178
this.saveButton.set_sensitive(false);
31893179
this.resetButton.set_sensitive(this.checkIfResetButtonSensitive());
@@ -3508,7 +3498,6 @@ var MenuSettingsFineTunePage = GObject.registerClass(
35083498
this._settings.set_boolean('disable-searchbox-border', this.disableSearchStyle);
35093499
this._settings.set_boolean('alphabetize-all-programs', this.alphabetizeAllPrograms);
35103500
this._settings.set_boolean('multi-lined-labels', this.multiLinedLabels);
3511-
this._settings.reset('reload-theme');
35123501
this._settings.set_boolean('reload-theme', true);
35133502
this.saveButton.set_sensitive(false);
35143503
this.resetButton.set_sensitive(this.checkIfResetButtonSensitive());
@@ -5116,7 +5105,7 @@ var MenuSettingsShortcutApplicationsPage = GObject.registerClass(
51165105
frameRow._cmd = applicationShortcuts[i][2];
51175106
iconString = frameRow._icon;
51185107
if(frameRow._icon === "" && Gio.DesktopAppInfo.new(frameRow._cmd)){
5119-
iconString = Gio.DesktopAppInfo.new(frameRow._cmd).get_icon().to_string();
5108+
iconString = Gio.DesktopAppInfo.new(frameRow._cmd).get_icon() ? Gio.DesktopAppInfo.new(frameRow._cmd).get_icon().to_string() : "";
51205109
}
51215110
let applicationIcon = new Gtk.Image( {
51225111
gicon: Gio.icon_new_for_string(iconString),
@@ -5181,7 +5170,7 @@ var MenuSettingsShortcutApplicationsPage = GObject.registerClass(
51815170
softwareShortcutsLabel.label = _(frameRow._name);
51825171
let iconString;
51835172
if(frameRow._icon === "" && Gio.DesktopAppInfo.new(frameRow._cmd)){
5184-
iconString = Gio.DesktopAppInfo.new(frameRow._cmd).get_icon().to_string();
5173+
iconString = Gio.DesktopAppInfo.new(frameRow._cmd).get_icon() ? Gio.DesktopAppInfo.new(frameRow._cmd).get_icon().to_string() : "";
51855174
}
51865175
applicationIcon.gicon = Gio.icon_new_for_string(iconString ? iconString : frameRow._icon);
51875176
dialog.destroy();

utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ function createStylesheet(settings){
393393

394394
+"StScrollView .small-vfade{\n-st-vfade-offset: 44px;\n}\n\n"
395395

396-
+".arc-menu-button{\n-st-icon-style: symbolic;\nmin-height:0px;\nborder-radius: 26px;\npadding: 13px;\n}\n\n"
396+
+".arc-menu-button{\n-st-icon-style: symbolic;\nmin-height: 0px;\nmin-width: 0px;\nborder-radius: 26px;\npadding: 13px;\n}\n\n"
397397

398398
+".arc-menu-action{\nmargin: 1px;\nbackground-color: transparent;\nbox-shadow: none;\ncolor:" + menuForegroundColor + ";\nborder-width: 1px;\n"
399399
+"border-color: transparent;\n}\n\n"

0 commit comments

Comments
 (0)