Skip to content

Commit

Permalink
icon size in menu configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLauinger77 committed Apr 20, 2023
1 parent e2f0429 commit b96fd7c
Show file tree
Hide file tree
Showing 18 changed files with 670 additions and 460 deletions.
Binary file modified menu_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions [email protected]/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ const Gettext = imports.gettext.domain("messagingmenu");
const _ = Gettext.gettext;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const ICON_SIZE = 22;

const _rgbToHex = (r, g, b) =>
"#" + [r, g, b].map((x) => x.toString(16).padStart(2, "0")).join("");

let ICON_SIZE = 22;
let _indicator;
let settings;
let originalStyle;
Expand Down Expand Up @@ -517,7 +516,7 @@ function enable() {
.get_string("compatible-hidden-mblog-notifiers")
.split(";")
.sort(Intl.Collator().compare);

ICON_SIZE = settings.get_int("icon-size");
_indicator = new MessageMenu();

_queuechanged_handler = Main.messageTray.connect(
Expand All @@ -539,4 +538,5 @@ function disable() {
_indicator.destroy();
_indicator = null;
settings = null;
ICON_SIZE = null;
}
31 changes: 31 additions & 0 deletions [email protected]/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,26 @@ class AdwPrefs {
);
}

_rangeslider(key, values, tooltip, settings) {
let [min, max, step, defv] = values;
let range = Gtk.Scale.new_with_range(
Gtk.Orientation.HORIZONTAL,
min,
max,
step
);
range.set_tooltip_text(tooltip);
range.set_value(settings.get_int(key));
range.set_draw_value(true);
range.add_mark(defv, Gtk.PositionType.BOTTOM, null);
range.set_size_request(200, -1);

range.connect("value-changed", function (slider) {
settings.set_int(key, slider.get_value());
});
return range;
}

_page1() {
let email_setting_switch = this._builder.get_object(
"email_setting_switch"
Expand Down Expand Up @@ -286,6 +306,17 @@ class AdwPrefs {
"color-set",
this._onColorChanged.bind(this, color_setting_button)
);
let row5 = this._builder.get_object("messagingmenu_row5");

let iconsize_slider = this._rangeslider(
"icon-size",
[12, 48, 1, 22],
_("Size of the app icons in the menu"),
this._settings
);
row5.add_suffix(iconsize_slider);
row5.activatable_widget = iconsize_slider;

let group_add = this._builder.get_object("messagingmenu_group_add");
let cmb_add = this._builder.get_object("messagingmenu_cmb_add");
cmb_add.set_active(0);
Expand Down
5 changes: 5 additions & 0 deletions [email protected]/prefs.ui
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
</child>
</object>
</child>
<child>
<object class="AdwActionRow" id="messagingmenu_row5">
<property name="title" translatable="yes">Icon size (pixel)</property>
</object>
</child>
</object>
</child>
<child>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@
<summary>Compatible hidden Email Notifiers</summary>
<description>Must be their Notificationtitle, because lookup_app doesnt work here</description>
</key>
<key name="compatible-hidden-mblog-notifiers" type="s">
<key name="compatible-hidden-mblog-notifiers" type="s">
<default>'friends;GFeedLine;gwibber'</default>
<summary>Compatible hidden MBlog Notifiers</summary>
<description>Must be their Notificationtitle, because lookup_app doesnt work here</description>
</key>
<key name="icon-size" type="i">
<default>22</default>
<summary>Icon size</summary>
<description>Size of the app icons in the menu</description>
</key>
</schema>
</schemalist>
83 changes: 48 additions & 35 deletions po/af.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-04-13 18:19+0200\n"
"POT-Creation-Date: 2023-04-20 16:38+0200\n"
"PO-Revision-Date: 2022-11-18 09:56+0100\n"
"Last-Translator: Christian Lauinger <[email protected]>\n"
"Language-Team: \n"
Expand All @@ -18,15 +18,15 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.2\n"

#: [email protected]/extension.js:80
#: [email protected]/extension.js:81
msgid "Compose New Message"
msgstr "Skryf Nuwe Boodskap"

#: [email protected]/extension.js:81
#: [email protected]/extension.js:82
msgid "Contacts"
msgstr "Kontakte"

#: [email protected]/extension.js:231
#: [email protected]/extension.js:256
#: [email protected]/prefs.ui:5
#: [email protected]/prefs.ui:9
msgid "Settings"
Expand All @@ -52,104 +52,113 @@ msgid "Micro Blogging Notification:"
msgstr "Mikro Blog Kennisgewing:"

#: [email protected]/prefs.js:158
#: [email protected]/prefs.ui:59
#: [email protected]/prefs.ui:112
#: [email protected]/prefs.ui:123
#: [email protected]/prefs.ui:134
#: [email protected]/prefs.ui:64
#: [email protected]/prefs.ui:117
#: [email protected]/prefs.ui:128
#: [email protected]/prefs.ui:139
msgid "Name of .desktop files without .desktop ending"
msgstr ""

#: [email protected]/prefs.js:161
#: [email protected]/prefs.ui:145
#: [email protected]/prefs.ui:151
#: [email protected]/prefs.ui:150
#: [email protected]/prefs.ui:156
msgid "Notifier title"
msgstr "Kennisgewing"

#: [email protected]/prefs.js:219
msgid "Select desktop file"
msgstr ""

#: [email protected]/prefs.js:249
#: [email protected]/prefs.js:269
#, fuzzy
msgid "Toggle email notification"
msgstr "E-pos Kennisgewing:"

#: [email protected]/prefs.js:259
#: [email protected]/prefs.js:279
#, fuzzy
msgid "Toggle chat notification"
msgstr "Chat Kennisgewing:"

#: [email protected]/prefs.js:270
#: [email protected]/prefs.js:290
#, fuzzy
msgid "Toggle micro blogging notification"
msgstr "Mikro Blog Kennisgewing:"

#: [email protected]/prefs.js:281
#: [email protected]/prefs.js:301
#: [email protected]/schemas/org.gnome.shell.extensions.messagingmenu.gschema.xml:26
msgid "Notification Color RGB"
msgstr "Kennisgewing Kleur (RGB)"

#: [email protected]/prefs.js:305
#: [email protected]/prefs.js:314
#: [email protected]/schemas/org.gnome.shell.extensions.messagingmenu.gschema.xml:57
msgid "Size of the app icons in the menu"
msgstr ""

#: [email protected]/prefs.js:336
msgid "Usually located in '/usr/share/applications'"
msgstr ""

#: [email protected]/prefs.js:308
#: [email protected]/prefs.js:339
msgid "..."
msgstr ""

#: [email protected]/prefs.js:318
#: [email protected]/prefs.js:349
msgid "Select desktop file for "
msgstr ""

#: [email protected]/prefs.ui:45
msgid "Notification Color (RGB)"
msgstr "Kennisgewing Kleur (RGB)"

#: [email protected]/prefs.ui:58
#: [email protected]/prefs.ui:56
msgid "Icon size (pixel)"
msgstr ""

#: [email protected]/prefs.ui:63
msgid "Add menu"
msgstr ""

#: [email protected]/prefs.ui:62
#: [email protected]/prefs.ui:67
msgid "Type:"
msgstr ""

#: [email protected]/prefs.ui:69
#: [email protected]/prefs.ui:107
#: [email protected]/prefs.ui:111
#: [email protected]/prefs.ui:74
#: [email protected]/prefs.ui:112
#: [email protected]/prefs.ui:116
msgid "Email"
msgstr ""

#: [email protected]/prefs.ui:70
#: [email protected]/prefs.ui:118
#: [email protected]/prefs.ui:122
#: [email protected]/prefs.ui:75
#: [email protected]/prefs.ui:123
#: [email protected]/prefs.ui:127
msgid "Chat"
msgstr ""

#: [email protected]/prefs.ui:71
#: [email protected]/prefs.ui:129
#: [email protected]/prefs.ui:133
#: [email protected]/prefs.ui:76
#: [email protected]/prefs.ui:134
#: [email protected]/prefs.ui:138
msgid "Micro blogging"
msgstr "Mikro Blog:"

#: [email protected]/prefs.ui:72
#: [email protected]/prefs.ui:144
#: [email protected]/prefs.ui:77
#: [email protected]/prefs.ui:149
msgid "Email notifier"
msgstr "E-pos Kennisgewing"

#: [email protected]/prefs.ui:73
#: [email protected]/prefs.ui:150
#: [email protected]/prefs.ui:78
#: [email protected]/prefs.ui:155
msgid "Micro blogging notifier"
msgstr "Mikro Blog Kennisgewing"

#: [email protected]/prefs.ui:81
#: [email protected]/prefs.ui:86
msgid "Name:"
msgstr ""

#: [email protected]/prefs.ui:96
#: [email protected]/prefs.ui:101
msgid "Add"
msgstr ""

#: [email protected]/prefs.ui:140
#: [email protected]/prefs.ui:145
msgid "Notifier"
msgstr "Kennisgewing"

Expand Down Expand Up @@ -222,6 +231,10 @@ msgstr ""
msgid "Compatible hidden MBlog Notifiers"
msgstr ""

#: [email protected]/schemas/org.gnome.shell.extensions.messagingmenu.gschema.xml:56
msgid "Icon size"
msgstr ""

#~ msgid "Notification Color (RGB):"
#~ msgstr "Kennisgewing Kleur (RGB):"

Expand Down
Loading

0 comments on commit b96fd7c

Please sign in to comment.