Add context menu to donation icon

This commit is contained in:
Charles Gagnon
2025-01-30 14:22:32 -05:00
parent 21bfe46e02
commit ac9c2b4b06
3 changed files with 26 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ MODULES = ./*.js stylesheet.css metadata.json COPYING README.md
UI_MODULES = ui/*.ui
IMAGES = ./* ../media/design/svg/dash-to-panel-logo-light.svg
TOLOCALIZE = prefs.js appIcons.js
TOLOCALIZE = prefs.js appIcons.js taskbar.js
MSGSRC = $(wildcard po/*.po)
ifeq ($(strip $(DESTDIR)),)
INSTALLBASE = $(HOME)/.local/share/gnome-shell/extensions

View File

@@ -7,9 +7,9 @@
#
msgid ""
msgstr ""
"Project-Id-Version: DAsh To PAnel\n"
"Project-Id-Version: Dash To Panel\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-30 10:54-0500\n"
"POT-Creation-Date: 2025-01-30 14:13-0500\n"
"PO-Revision-Date: 2025-01-30 11:29-0500\n"
"Last-Translator: Charles Gagnon <charlesg99@outlook.com>\n"
"Language-Team: French\n"
@@ -343,6 +343,18 @@ msgstr "Restaurer les fenêtres"
msgid "Show Desktop"
msgstr "Afficher le bureau"
#: taskbar.js:64
msgid "Donation options"
msgstr "Options de don"
#: taskbar.js:79
msgid "Thank you!"
msgstr "Merci!"
#: taskbar.js:79
msgid "Please donate :)"
msgstr "Merci de faire un don :)"
#: ui/BoxAdvancedOptions.ui.h:1
msgid "Nothing yet!"
msgstr "Rien pour l'instant !"

View File

@@ -56,16 +56,24 @@ const T3 = 'resetHoverTimeout'
const T4 = 'donateAppTimeout'
let donateDummyApp = {
app_info: {
should_show: () => false,
list_actions: () => ['opts'],
get_action_name: (action) => action == 'opts' ? _('Donation options') : '',
},
connect: () => [],
connectObject: () => [],
get_id: () => "dtp_donate",
get_id: () => 'dtp_donate',
get_windows: () => [],
can_open_new_window: () => false,
launch_action: function(action) { action == 'opts' ? this.activate() : null },
get_name: function() {
return this.isActive() ? _('Thank you!') : _("Please donate :)")
return this.isActive() ? _('Thank you!') : _('Please donate :)')
},
create_icon_texture: function(size) {
return new St.Icon({
icon_name: this.isActive() ? 'face-smile' : 'emote-love',
icon_name: this.isActive() ? 'face-smile-big-symbolic' : 'emote-love-symbolic',
style: `color: ${this.isActive() ? '#FFC730' : '#C71807'}`,
icon_size: size
})
},