Removing offsets from LevelBars to keep consistent colors

parent f1ae3601
Version 0.12.1
==============
Released: 2019-02-17
* Removing offsets from LevelBars to keep consistent colors
Version 0.12.0
==============
Released: 2019-02-17
......
......@@ -27,6 +27,13 @@
<url type="bugtracker">https://gitlab.com/leinardi/gwe/issues</url>
<update_contact>roberto@leinardi.com</update_contact>
<releases>
<release date="2019-02-17" version="0.12.1">
<description>
<ul>
<li>Removing offsets from LevelBars to keep consistent colors</li>
</ul>
</description>
</release>
<release date="2019-02-17" version="0.12.0">
<description>
<ul>
......
......@@ -456,7 +456,6 @@ along with gwe. If not, see <http://www.gnu.org/licenses/>.
<object class="GtkLevelBar" id="info_decoder_usage_levelbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="max_value">100</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -497,7 +496,6 @@ along with gwe. If not, see <http://www.gnu.org/licenses/>.
<object class="GtkLevelBar" id="info_encoder_usage_levelbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="max_value">100</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -570,7 +568,6 @@ along with gwe. If not, see <http://www.gnu.org/licenses/>.
<object class="GtkLevelBar" id="info_gpu_usage_levelbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="max_value">100</property>
</object>
<packing>
<property name="left_attach">1</property>
......@@ -582,7 +579,6 @@ along with gwe. If not, see <http://www.gnu.org/licenses/>.
<object class="GtkLevelBar" id="info_memory_usage_levelbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="max_value">100</property>
</object>
<packing>
<property name="left_attach">1</property>
......
......@@ -20,9 +20,7 @@ from collections import OrderedDict
from typing import Optional, Dict, List, Tuple, Any
from gwe.di import MainBuilder
from gwe.repository import NOT_AVAILABLE_STRING
from gwe.view.edit_fan_profile import EditFanProfileView
from gwe.util.path import get_data_path
from gwe.util.view import hide_on_delete, init_plot_chart, get_fan_profile_data, is_dazzle_version_supported
from injector import inject, singleton
import gi
......@@ -30,13 +28,12 @@ from gi.repository import Gtk
from matplotlib.figure import Figure
from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigureCanvas
# AppIndicator3 may not be installed
from gwe.interactor import SettingsInteractor
from gwe.view.edit_overclock_profile import EditOverclockProfileView
from gwe.view.historical_data import HistoricalDataView
from gwe.view.preferences import PreferencesView
try:
try: # AppIndicator3 may not be installed
gi.require_version('AppIndicator3', '0.1')
from gi.repository import AppIndicator3
except (ImportError, ValueError):
......@@ -237,6 +234,10 @@ class MainView(MainViewInterface):
self._overclock_warning_label.set_visible(not gpu_status.overclock.available)
self._fan_profile_frame.set_sensitive(gpu_status.fan.control_allowed)
self._fan_warning_label.set_visible(not gpu_status.fan.control_allowed)
self._remove_level_bar_offsets(self._info_gpu_usage_levelbar)
self._remove_level_bar_offsets(self._info_memory_usage_levelbar)
self._remove_level_bar_offsets(self._info_encoder_usage_levelbar)
self._remove_level_bar_offsets(self._info_decoder_usage_levelbar)
minimum = gpu_status.power.minimum
maximum = gpu_status.power.maximum
default = gpu_status.power.default
......@@ -277,8 +278,8 @@ class MainView(MainViewInterface):
self._set_entry_text(self._clocks_memory_max_entry, "%d MHz", gpu_status.clocks.memory_max)
self._set_entry_text(self._clocks_video_current_entry, "%d MHz", gpu_status.clocks.video_current)
self._set_entry_text(self._clocks_video_max_entry, "%d MHz", gpu_status.clocks.video_max)
self._set_level_bar(self._info_memory_usage_levelbar, gpu_status.info.memory_usage)
self._set_level_bar(self._info_gpu_usage_levelbar, gpu_status.info.gpu_usage)
self._set_level_bar(self._info_memory_usage_levelbar, gpu_status.info.memory_usage)
self._set_level_bar(self._info_encoder_usage_levelbar, gpu_status.info.encoder_usage)
self._set_level_bar(self._info_decoder_usage_levelbar, gpu_status.info.decoder_usage)
if gpu_status.overclock.available:
......@@ -324,10 +325,17 @@ class MainView(MainViewInterface):
label.set_sensitive(False)
label.set_markup('')
@staticmethod
def _remove_level_bar_offsets(levelbar: Gtk.LevelBar) -> None:
levelbar.remove_offset_value("low")
levelbar.remove_offset_value("high")
levelbar.remove_offset_value("full")
levelbar.remove_offset_value("alert")
@staticmethod
def _set_level_bar(levelbar: Gtk.LevelBar, value: Optional[int]) -> None:
if value is not None:
levelbar.set_value(int(value))
levelbar.set_value(value / 100)
levelbar.set_sensitive(True)
else:
levelbar.set_value(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment