Skip to content

Fixed animation smoothness and CPU speed based interval. #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions po/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: gnome-runcat-extension 26\n"
"Project-Id-Version: gnome-runcat-extension \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-04 10:53+0300\n"
"POT-Creation-Date: 2023-11-28 13:09+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -17,11 +17,11 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: src/indicator.js:161
#: src/indicator.js:168
msgid "Open System Monitor"
msgstr ""

#: src/indicator.js:165
#: src/indicator.js:172
msgid "Settings"
msgstr ""

Expand Down
6 changes: 3 additions & 3 deletions po/ru.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gnome-runcat-extension 20\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-04 10:43+0300\n"
"POT-Creation-Date: 2023-11-28 09:46+0800\n"
"PO-Revision-Date: 2022-09-30 19:16+0300\n"
"Last-Translator: Sergei Kolesnikov <[email protected]>\n"
"Language-Team: Russian\n"
Expand All @@ -18,11 +18,11 @@ 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"

#: src/indicator.js:161
#: src/indicator.js:168
msgid "Open System Monitor"
msgstr "Открыть Системный монитор"

#: src/indicator.js:165
#: src/indicator.js:172
msgid "Settings"
msgstr "Настройки"

Expand Down
13 changes: 10 additions & 3 deletions src/indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,16 @@ const spritesGenerator = function* (extensionRootPath, state) {
*
* @returns {number} delay between sprites in millisecons
**/
const getAnimationInterval = (cpuUtilization, spritesCount) => Math.ceil(
(25 / Math.sqrt(cpuUtilization + 30) - 2) * 1_000 / spritesCount,
)
const getAnimationInterval = (cpuUtilization, spritesCount) => {
const cpuSpeedBasedReductor = Math.max(
300,
Math.floor(cpuUtilization / 5) * 62
)

return Math.ceil(
(25 / Math.sqrt(cpuUtilization + 30) - 2) * cpuSpeedBasedReductor / spritesCount,
)
}


export default class RunCatIndicator extends PanelMenuButton {
Expand Down
4 changes: 2 additions & 2 deletions src/resources/icons/runcat/active/sprite-0-symbolic.svg
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 src/resources/icons/runcat/active/sprite-1-symbolic.svg
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 src/resources/icons/runcat/active/sprite-2-symbolic.svg
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 src/resources/icons/runcat/active/sprite-3-symbolic.svg
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 src/resources/icons/runcat/active/sprite-4-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/resources/icons/runcat/idle/sprite-0-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions src/stylesheet.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
.runcat-menu__icon {
padding: 0 .5em 0 0;
icon-size: 2em;
padding: 0;
-webkit-transition : all 0.2s ease-in-out;
-moz-transition : all 0.2s ease-in-out;
-o-transition : all 0.2s ease-in-out;
transition : all 0.2s ease-in-out;
will-change: all;
icon-size: 4.5em;
width: 2em;
}

.runcat-menu__label {
font-size: .9em;
font-size: 0.9em;
line-height: 1;
}