Skip to content

Commit

Permalink
Release v21
Browse files Browse the repository at this point in the history
  • Loading branch information
ljuzig committed Apr 19, 2024
1 parent c20abb8 commit 0247d84
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 22 deletions.
1 change: 1 addition & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Astra Monitor 21 - April 19 2024

### Bug fixes

- Fixed visual bug for system with `scale-monitor-framebuffer` feature disabled [[#110](https://github.com/AstraExt/astra-monitor/issues/110)]

- Fixed GPU monitoring starting even when the GPU menu is disabled
Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"settings-schema": "org.gnome.shell.extensions.astra-monitor",
"gettext-domain": "[email protected]",
"license": "GPL-3.0-or-later",
"version": 31,
"version-name": "20",
"version": 32,
"version-name": "21",
"donations": {
"buymeacoffee": "astra.ext",
"patreon": "AstraExt"
Expand Down
4 changes: 2 additions & 2 deletions po/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Astra Monitor 31\n"
"Project-Id-Version: Astra Monitor 32\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-17 04:01+0200\n"
"POT-Creation-Date: 2024-04-19 22:21+0200\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 Down
18 changes: 7 additions & 11 deletions src/bars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ export default GObject.registerClass(
let styleClass;
if(this.layout === 'vertical') {
styleClass = 'astra-monitor-bars-vertical';
}
else {
} else {
styleClass = 'astra-monitor-bars-horizontal';
}

Expand All @@ -187,15 +186,14 @@ export default GObject.registerClass(
let [width, height] = this.get_size();
width /= this.scaleFactor;
height /= this.scaleFactor;

let size;
if(this.layout === 'vertical') {
size = height - 4;
}
else {
} else {
size = width - 4;
}

if(!values || values.length === 0) {
for(let i = 0; i < this.bars.length; i++) {
const bar = this.bars[i];
Expand Down Expand Up @@ -232,15 +230,13 @@ export default GObject.registerClass(
const zero = Math.round(value[l].value * 100) < 1 ? 0 : 1;
const normalizedValue = value[l].value * size;
let fillSize = zero;
if(normalizedValue >= 0.5)
fillSize = Math.ceil(normalizedValue);
if(normalizedValue >= 0.5) fillSize = Math.ceil(normalizedValue);
if(isNaN(fillSize) || fillSize < zero) fillSize = zero;

if(this.layout === 'vertical') {
const position = size - start - fillSize;
layer.set_position(0, position * this.scaleFactor);
}
else {
} else {
const position = start;
layer.set_position(position * this.scaleFactor, 0);
}
Expand Down
9 changes: 4 additions & 5 deletions src/gpu/gpuMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export default class GpuMonitor extends Monitor {
};
Config.connect(this, 'changed::gpu-main', updateGpu.bind(this));
updateGpu();

this.updateMonitorStatus();
}

Expand All @@ -379,12 +379,11 @@ export default class GpuMonitor extends Monitor {
updateMonitorStatus() {
if(Config.get_boolean('gpu-header-show') || this.isListeningFor('gpuUpdateProcessor')) {
this.start();
}
else {
} else {
this.stop();
}
}

restart() {
if(!Config.get_boolean('gpu-header-show') && !this.isListeningFor('gpuUpdateProcessor'))
return;
Expand Down Expand Up @@ -429,7 +428,7 @@ export default class GpuMonitor extends Monitor {

private startGpuTask() {
Utils.log('startGpuTask!');

const selectedGpu = Utils.getSelectedGPU();
if(!selectedGpu) return;

Expand Down
2 changes: 1 addition & 1 deletion src/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default GObject.registerClass(
showTooltip() {}

hideTooltip() {}

get scaleFactor() {
const themeContext = St.ThemeContext.get_for_stage(global.get_stage());
if(themeContext.get_scale_factor) {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/storageBars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default GObject.registerClass(
return;
}

this.updateBars([[{ color: 0, value: 1/*usage.usePercentage / 100.0*/ }]]);
this.updateBars([[{ color: 0, value: 1 /*usage.usePercentage / 100.0*/ }]]);
}
}
);

0 comments on commit 0247d84

Please sign in to comment.