Skip to content

Commit

Permalink
[suspend@janax] Fix handling of UI scale factors (#6454)
Browse files Browse the repository at this point in the history
* Better handling of cases where the UI scale factor is not 100%
  • Loading branch information
klangman authored Sep 30, 2024
1 parent 35374bc commit ac522ec
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 63 deletions.
4 changes: 4 additions & 0 deletions suspend@janax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.0.4

* A fix for handling cases where a UI scaling factor is used (Display user interface scale is something other than 100%)

## 2.0.3

* Added an option to allow Ctrl-Click to bypass the count down timer and suspend immediately
Expand Down
9 changes: 8 additions & 1 deletion suspend@janax/files/suspend@janax/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class SuspendApplet extends Applet.Applet {

// Icon Box to contain the icon and the count down label
let iconSize = this.getPanelIconSize( (this.settings.getValue("fullcolor-icon")) ? St.IconType.FULLCOLOR : St.IconType.SYMBOLIC);
this._iconBox = new St.Group({natural_width: iconSize, natural_height: iconSize, x_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER});
this._iconBox = new St.Group({natural_width: iconSize * global.ui_scale, natural_height: iconSize * global.ui_scale, x_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER});

// Create the icon and it's container
this.actor.add_actor(this._iconBox);
Expand All @@ -47,6 +47,13 @@ class SuspendApplet extends Applet.Applet {
this._labelNumberBox.hide();
this.set_applet_tooltip(_("Suspend"));
this.signalManager.connect(this.settings, "changed::fullcolor-icon", this._updateIcon, this);
this.signalManager.connect(global, "scale-changed", this._updateUIScale, this);
}

_updateUIScale() {
let iconSize = this.getPanelIconSize( (this.settings.getValue("fullcolor-icon")) ? St.IconType.FULLCOLOR : St.IconType.SYMBOLIC);
this._iconBox.set_width( iconSize * global.ui_scale );
this._iconBox.set_height( iconSize * global.ui_scale );
}

_updateIcon() {
Expand Down
2 changes: 1 addition & 1 deletion suspend@janax/files/suspend@janax/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"description": "Immediately suspends the computer",
"uuid": "suspend@janax",
"name": "Suspend computer",
"version": "2.0.3",
"version": "2.0.4",
"max-instances": -1
}
8 changes: 4 additions & 4 deletions suspend@janax/files/suspend@janax/po/ca.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# SUSPEND COMPUTER
# This file is put in the public domain.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# janax, 2016
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: suspend@janax 2.0.2\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
"PO-Revision-Date: 2024-07-10 01:24+0200\n"
"Last-Translator: Odyssey <[email protected]>\n"
"Language-Team: \n"
Expand All @@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.2\n"

#: applet.js:48
#. applet.js:48
msgid "Suspend"
msgstr "Suspendre"

Expand Down
8 changes: 4 additions & 4 deletions suspend@janax/files/suspend@janax/po/da.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# SUSPEND COMPUTER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# janax, 2016
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
"PO-Revision-Date: 2017-10-03 19:20+0200\n"
"Last-Translator: Alan Mortensen <[email protected]>\n"
"Language-Team: \n"
Expand All @@ -19,7 +19,7 @@ msgstr ""
"X-Generator: Poedit 1.8.7.1\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: applet.js:48
#. applet.js:48
#, fuzzy
msgid "Suspend"
msgstr "Sæt i hviletilstand"
Expand Down
8 changes: 4 additions & 4 deletions suspend@janax/files/suspend@janax/po/de.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# SUSPEND COMPUTER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# janax, 2016
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
"PO-Revision-Date: 2021-02-16 18:30+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand All @@ -19,7 +19,7 @@ msgstr ""
"X-Generator: Poedit 2.3\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: applet.js:48
#. applet.js:48
#, fuzzy
msgid "Suspend"
msgstr "In Bereitschaft versetzen"
Expand Down
8 changes: 4 additions & 4 deletions suspend@janax/files/suspend@janax/po/es.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# SUSPEND COMPUTER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# janax, 2016
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
"PO-Revision-Date: 2024-03-08 11:25-0300\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand All @@ -19,7 +19,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.4.2\n"

#: applet.js:48
#. applet.js:48
msgid "Suspend"
msgstr "Suspender"

Expand Down
8 changes: 4 additions & 4 deletions suspend@janax/files/suspend@janax/po/fr.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# SUSPEND COMPUTER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# janax, 2016
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
"PO-Revision-Date: 2024-04-03 15:28+0200\n"
"Last-Translator: Claudiux <[email protected]>\n"
"Language-Team: \n"
Expand All @@ -19,7 +19,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.0.1\n"

#: applet.js:48
#. applet.js:48
msgid "Suspend"
msgstr "Mettre en veille"

Expand Down
6 changes: 3 additions & 3 deletions suspend@janax/files/suspend@janax/po/hr.po
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SOME DESCRIPTIVE TITLE.
# SUSPEND COMPUTER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# <[email protected]>, 2017.
Expand All @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: suspend@janax\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
"PO-Revision-Date: 2017-05-08 14:04+0200\n"
"Last-Translator: gogo <[email protected]>\n"
"Language-Team: \n"
Expand All @@ -20,7 +20,7 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

#: applet.js:48
#. applet.js:48
#, fuzzy
msgid "Suspend"
msgstr "Suspendiraj"
Expand Down
8 changes: 4 additions & 4 deletions suspend@janax/files/suspend@janax/po/hu.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SOME DESCRIPTIVE TITLE.
# SUSPEND COMPUTER
# This file is put in the public domain.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# janax, 2016
#
msgid ""
msgstr ""
"Project-Id-Version: suspend@janax 2.0.2\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
"PO-Revision-Date: 2024-07-28 08:01-0400\n"
"Last-Translator: Vajda Örs <[email protected]>\n"
"Language-Team: \n"
Expand All @@ -18,7 +18,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.0.1\n"

#: applet.js:48
#. applet.js:48
msgid "Suspend"
msgstr "Felfüggesztés"

Expand Down
18 changes: 9 additions & 9 deletions suspend@janax/files/suspend@janax/po/it.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# SUSPEND COMPUTER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# janax, 2016
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
"PO-Revision-Date: 2024-06-18 16:00+0200\n"
"Last-Translator: Dragone2 <[email protected]>\n"
"Language-Team: \n"
Expand All @@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.0.1\n"

#: applet.js:48
#. applet.js:48
msgid "Suspend"
msgstr "Sospendi"

Expand All @@ -43,8 +43,8 @@ msgid ""
"When enabled, a double-click will suspend the computer, otherwise the "
"computer will suspend on a single click."
msgstr ""
"Se abilitato, un doppio clic sospenderà il computer, altrimenti il ​​"
"computer verrà sospeso con un singolo clic."
"Se abilitato, un doppio clic sospenderà il computer, altrimenti il ​​computer "
"verrà sospeso con un singolo clic."

#. settings-schema.json->count-down->description
msgid "Use a count down before suspending"
Expand Down Expand Up @@ -79,9 +79,9 @@ msgid ""
"without starting a count down or waiting for an existing count down to "
"finish."
msgstr ""
"Se abilitato, l'utilizzo di Ctrl+clic sospenderà immediatamente il "
"computer, senza avviare un conto alla rovescia o attendere il "
"completamento di un conto alla rovescia esistente."
"Se abilitato, l'utilizzo di Ctrl+clic sospenderà immediatamente il computer, "
"senza avviare un conto alla rovescia o attendere il completamento di un "
"conto alla rovescia esistente."

#. settings-schema.json->fullcolor-icon->description
msgid "Use a full color icon"
Expand Down
8 changes: 4 additions & 4 deletions suspend@janax/files/suspend@janax/po/nl.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SOME DESCRIPTIVE TITLE.
# SUSPEND COMPUTER
# This file is put in the public domain.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# janax, 2016
#
msgid ""
msgstr ""
"Project-Id-Version: suspend@janax 2.0.2\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
"PO-Revision-Date: 2024-04-21 20:37+0200\n"
"Last-Translator: qadzek\n"
"Language-Team: \n"
Expand All @@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: applet.js:48
#. applet.js:48
msgid "Suspend"
msgstr "Slapen"

Expand Down
6 changes: 3 additions & 3 deletions suspend@janax/files/suspend@janax/po/pt_BR.po
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SOME DESCRIPTIVE TITLE.
# SUSPEND COMPUTER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Marcelo Aof, 2021.
Expand All @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
"PO-Revision-Date: 2021-10-01 13:55-0300\n"
"Last-Translator: Marcelo Aof\n"
"Language-Team: \n"
Expand All @@ -19,7 +19,7 @@ msgstr ""
"X-Generator: Poedit 3.0\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#: applet.js:48
#. applet.js:48
#, fuzzy
msgid "Suspend"
msgstr "Suspender"
Expand Down
8 changes: 4 additions & 4 deletions suspend@janax/files/suspend@janax/po/ru.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SOME DESCRIPTIVE TITLE.
# SUSPEND COMPUTER
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# janax, 2016
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
"PO-Revision-Date: 2017-05-02 19:56+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand All @@ -20,7 +20,7 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

#: applet.js:48
#. applet.js:48
#, fuzzy
msgid "Suspend"
msgstr "приостановить"
Expand Down
16 changes: 8 additions & 8 deletions suspend@janax/files/suspend@janax/po/[email protected]
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# SOME DESCRIPTIVE TITLE.
# SUSPEND COMPUTER
# This file is put in the public domain.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# janax, 2016
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: suspend@janax 2.0.2\n"
"Project-Id-Version: suspend@janax 2.0.4\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: applet.js:48
#. applet.js:48
msgid "Suspend"
msgstr ""

Expand Down
Loading

0 comments on commit ac522ec

Please sign in to comment.