Skip to content

Commit

Permalink
Reverse transparency slider
Browse files Browse the repository at this point in the history
to be more accurate.

Fix #1501

Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
  • Loading branch information
gsemet committed Apr 3, 2019
1 parent 30a5be3 commit b4beb72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions guake/globals.py
Expand Up @@ -99,3 +99,6 @@ def is_run_from_git_workdir():
r"^\s*(.*)\:([0-9]+)",
)
]

# Transparency max level (should be always 100)
MAX_TRANSPARENCY = 100
4 changes: 1 addition & 3 deletions guake/guake_app.py
Expand Up @@ -61,6 +61,7 @@
from guake.globals import ALIGN_RIGHT
from guake.globals import ALIGN_TOP
from guake.globals import ALWAYS_ON_PRIMARY
from guake.globals import MAX_TRANSPARENCY
from guake.globals import NAME
from guake.gsettings import GSettingHandler
from guake.guake_logging import setupLogging
Expand Down Expand Up @@ -105,9 +106,6 @@
GDK_WINDOW_STATE_STICKY = 8
GDK_WINDOW_STATE_ABOVE = 32

# Transparency max level (should be always 100)
MAX_TRANSPARENCY = 100


class Guake(SimpleGladeApp):

Expand Down
5 changes: 3 additions & 2 deletions guake/prefs.py
Expand Up @@ -49,6 +49,7 @@
from guake.globals import ALIGN_RIGHT
from guake.globals import ALIGN_TOP
from guake.globals import ALWAYS_ON_PRIMARY
from guake.globals import MAX_TRANSPARENCY
from guake.globals import NAME
from guake.globals import QUICK_OPEN_MATCHERS
from guake.globals import bindtextdomain
Expand Down Expand Up @@ -621,7 +622,7 @@ def on_transparency_value_changed(self, hscale):
"""
value = hscale.get_value()
self.prefDlg.set_colors_from_settings()
self.settings.styleBackground.set_int('transparency', int(value))
self.settings.styleBackground.set_int('transparency', MAX_TRANSPARENCY - int(value))

# compatibility tab

Expand Down Expand Up @@ -1260,7 +1261,7 @@ def load_configs(self):
self.set_cursor_blink_mode(value)

value = self.settings.styleBackground.get_int('transparency')
self.get_widget('background_transparency').set_value(value)
self.get_widget('background_transparency').set_value(MAX_TRANSPARENCY - value)

value = self.settings.general.get_int('window-valignment')
self.get_widget('top_align').set_active(value)
Expand Down

0 comments on commit b4beb72

Please sign in to comment.