Skip to content

Commit ac522ec

Browse files
authored
[suspend@janax] Fix handling of UI scale factors (#6454)
* Better handling of cases where the UI scale factor is not 100%
1 parent 35374bc commit ac522ec

File tree

17 files changed

+74
-63
lines changed

17 files changed

+74
-63
lines changed

suspend@janax/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2.0.4
4+
5+
* A fix for handling cases where a UI scaling factor is used (Display user interface scale is something other than 100%)
6+
37
## 2.0.3
48

59
* Added an option to allow Ctrl-Click to bypass the count down timer and suspend immediately

suspend@janax/files/suspend@janax/applet.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SuspendApplet extends Applet.Applet {
2727

2828
// Icon Box to contain the icon and the count down label
2929
let iconSize = this.getPanelIconSize( (this.settings.getValue("fullcolor-icon")) ? St.IconType.FULLCOLOR : St.IconType.SYMBOLIC);
30-
this._iconBox = new St.Group({natural_width: iconSize, natural_height: iconSize, x_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER});
30+
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});
3131

3232
// Create the icon and it's container
3333
this.actor.add_actor(this._iconBox);
@@ -47,6 +47,13 @@ class SuspendApplet extends Applet.Applet {
4747
this._labelNumberBox.hide();
4848
this.set_applet_tooltip(_("Suspend"));
4949
this.signalManager.connect(this.settings, "changed::fullcolor-icon", this._updateIcon, this);
50+
this.signalManager.connect(global, "scale-changed", this._updateUIScale, this);
51+
}
52+
53+
_updateUIScale() {
54+
let iconSize = this.getPanelIconSize( (this.settings.getValue("fullcolor-icon")) ? St.IconType.FULLCOLOR : St.IconType.SYMBOLIC);
55+
this._iconBox.set_width( iconSize * global.ui_scale );
56+
this._iconBox.set_height( iconSize * global.ui_scale );
5057
}
5158

5259
_updateIcon() {

suspend@janax/files/suspend@janax/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"description": "Immediately suspends the computer",
33
"uuid": "suspend@janax",
44
"name": "Suspend computer",
5-
"version": "2.0.3",
5+
"version": "2.0.4",
66
"max-instances": -1
77
}

suspend@janax/files/suspend@janax/po/ca.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# SUSPEND COMPUTER
22
# This file is put in the public domain.
3-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
3+
# janax, 2016
44
#
55
#, fuzzy
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: suspend@janax 2.0.2\n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
1010
"issues\n"
11-
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
11+
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
1212
"PO-Revision-Date: 2024-07-10 01:24+0200\n"
1313
"Last-Translator: Odyssey <[email protected]>\n"
1414
"Language-Team: \n"
@@ -18,7 +18,7 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"X-Generator: Poedit 3.4.2\n"
2020

21-
#: applet.js:48
21+
#. applet.js:48
2222
msgid "Suspend"
2323
msgstr "Suspendre"
2424

suspend@janax/files/suspend@janax/po/da.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# SUSPEND COMPUTER
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4+
# janax, 2016
55
#
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
1010
"issues\n"
11-
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
11+
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
1212
"PO-Revision-Date: 2017-10-03 19:20+0200\n"
1313
"Last-Translator: Alan Mortensen <[email protected]>\n"
1414
"Language-Team: \n"
@@ -19,7 +19,7 @@ msgstr ""
1919
"X-Generator: Poedit 1.8.7.1\n"
2020
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
2121

22-
#: applet.js:48
22+
#. applet.js:48
2323
#, fuzzy
2424
msgid "Suspend"
2525
msgstr "Sæt i hviletilstand"

suspend@janax/files/suspend@janax/po/de.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# SUSPEND COMPUTER
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4+
# janax, 2016
55
#
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
1010
"issues\n"
11-
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
11+
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
1212
"PO-Revision-Date: 2021-02-16 18:30+0100\n"
1313
"Last-Translator: \n"
1414
"Language-Team: \n"
@@ -19,7 +19,7 @@ msgstr ""
1919
"X-Generator: Poedit 2.3\n"
2020
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
2121

22-
#: applet.js:48
22+
#. applet.js:48
2323
#, fuzzy
2424
msgid "Suspend"
2525
msgstr "In Bereitschaft versetzen"

suspend@janax/files/suspend@janax/po/es.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# SUSPEND COMPUTER
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4+
# janax, 2016
55
#
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
1010
"issues\n"
11-
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
11+
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
1212
"PO-Revision-Date: 2024-03-08 11:25-0300\n"
1313
"Last-Translator: \n"
1414
"Language-Team: \n"
@@ -19,7 +19,7 @@ msgstr ""
1919
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
2020
"X-Generator: Poedit 3.4.2\n"
2121

22-
#: applet.js:48
22+
#. applet.js:48
2323
msgid "Suspend"
2424
msgstr "Suspender"
2525

suspend@janax/files/suspend@janax/po/fr.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# SUSPEND COMPUTER
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4+
# janax, 2016
55
#
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
1010
"issues\n"
11-
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
11+
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
1212
"PO-Revision-Date: 2024-04-03 15:28+0200\n"
1313
"Last-Translator: Claudiux <[email protected]>\n"
1414
"Language-Team: \n"
@@ -19,7 +19,7 @@ msgstr ""
1919
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
2020
"X-Generator: Poedit 3.0.1\n"
2121

22-
#: applet.js:48
22+
#. applet.js:48
2323
msgid "Suspend"
2424
msgstr "Mettre en veille"
2525

suspend@janax/files/suspend@janax/po/hr.po

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

23-
#: applet.js:48
23+
#. applet.js:48
2424
#, fuzzy
2525
msgid "Suspend"
2626
msgstr "Suspendiraj"

suspend@janax/files/suspend@janax/po/hu.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# SUSPEND COMPUTER
22
# This file is put in the public domain.
3-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
3+
# janax, 2016
44
#
55
msgid ""
66
msgstr ""
77
"Project-Id-Version: suspend@janax 2.0.2\n"
88
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
99
"issues\n"
10-
"POT-Creation-Date: 2024-03-07 23:19-0500\n"
10+
"POT-Creation-Date: 2024-09-29 20:37-0400\n"
1111
"PO-Revision-Date: 2024-07-28 08:01-0400\n"
1212
"Last-Translator: Vajda Örs <[email protected]>\n"
1313
"Language-Team: \n"
@@ -18,7 +18,7 @@ msgstr ""
1818
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
1919
"X-Generator: Poedit 3.0.1\n"
2020

21-
#: applet.js:48
21+
#. applet.js:48
2222
msgid "Suspend"
2323
msgstr "Felfüggesztés"
2424

0 commit comments

Comments
 (0)