Skip to content
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

Better distinguishing of inactive windows from the active one, by changing the background brightness #709

Merged
merged 6 commits into from
Mar 1, 2023
Merged
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
1 change: 1 addition & 0 deletions terminatorlib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
'custom_url_handler' : '',
'disable_real_transparency' : False,
'inactive_color_offset': 0.8,
'inactive_bg_color_offset': 1.0,
'enabled_plugins' : ['LaunchpadBugURLHandler',
'LaunchpadCodeURLHandler',
'APTURLHandler'],
Expand Down
171 changes: 113 additions & 58 deletions terminatorlib/preferences.glade
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@
<property name="step-increment">0.10</property>
<property name="page-increment">0.20</property>
</object>
<object class="GtkAdjustment" id="adjustment8">
<property name="upper">1</property>
<property name="step-increment">0.10</property>
<property name="page-increment">0.20</property>
</object>
<object class="GtkAdjustment" id="adjustment_cellheight">
<property name="lower">1</property>
<property name="upper">2</property>
Expand Down Expand Up @@ -887,7 +892,7 @@
<property name="spacing">36</property>
<property name="homogeneous">True</property>
<child>
<!-- n-columns=3 n-rows=6 -->
<!-- n-columns=3 n-rows=7 -->
<object class="GtkGrid" id="grid3">
<property name="visible">True</property>
<property name="can-focus">False</property>
Expand All @@ -906,7 +911,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
<property name="top-attach">4</property>
<property name="width">3</property>
</packing>
</child>
Expand Down Expand Up @@ -960,7 +965,7 @@
<property name="can-focus">True</property>
<property name="halign">baseline</property>
<property name="hexpand">True</property>
<property name="adjustment">adjustment7</property>
<property name="adjustment">adjustment8</property>
<property name="round-digits">2</property>
<property name="digits">2</property>
<property name="draw-value">False</property>
Expand Down Expand Up @@ -1030,7 +1035,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
Expand All @@ -1046,7 +1051,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">5</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
Expand All @@ -1064,7 +1069,7 @@
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">5</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
Expand All @@ -1081,7 +1086,7 @@
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">4</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
Expand All @@ -1097,7 +1102,7 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
Expand All @@ -1109,7 +1114,52 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label35">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Unfocused terminal background color:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="inactive_bg_color_offset_value_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">100%</property>
<property name="justify">right</property>
<property name="width-chars">5</property>
<property name="max-width-chars">5</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkScale" id="inactive_bg_color_offset">
<property name="width-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="adjustment">adjustment7</property>
<property name="round-digits">2</property>
<property name="digits">2</property>
<property name="draw-value">False</property>
<property name="value-pos">bottom</property>
<signal name="value-changed" handler="on_inactive_bg_color_offset_value_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">3</property>
</packing>
</child>
</object>
Expand Down Expand Up @@ -3721,81 +3771,86 @@
</child>
<child>
<object class="GtkVBox" id="vbox124">
<child>
<property name="can-focus">False</property>
<child>
<object class="GtkEntry" id="keybindingsearchentry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="has-focus">False</property>
<property name="placeholder_text">filter keybindings</property>
<property name="placeholder-text">filter keybindings</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="vadjustment">adjustment4</property>
<property name="hscrollbar-policy">never</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeView" id="keybindingtreeview">
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="has-focus">True</property>
<property name="model">KeybindingsListStore</property>
<property name="headers-clickable">False</property>
<property name="search-column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection4"/>
</child>
<property name="vadjustment">adjustment4</property>
<property name="hscrollbar-policy">never</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="title" translatable="yes">Name</property>
<object class="GtkTreeView" id="keybindingtreeview">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="has-focus">True</property>
<property name="model">KeybindingsListStore</property>
<property name="headers-clickable">False</property>
<property name="search-column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection4"/>
</child>
<child>
<object class="GtkCellRendererText" id="cellrenderertext10"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="title" translatable="yes">Name</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext10"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn2">
<property name="title" translatable="yes">Action</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext11"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
<object class="GtkTreeViewColumn" id="treeviewcolumn2">
<property name="title" translatable="yes">Action</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext11"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn3">
<property name="title" translatable="yes">Keybinding</property>
<child>
<object class="GtkCellRendererAccel" id="cellrendereraccel1">
<property name="editable">True</property>
<property name="accel-mode">other</property>
<signal name="accel-cleared" handler="on_cellrenderer_accel_cleared" object="KeybindingsListStore" swapped="yes"/>
<signal name="accel-edited" handler="on_cellrenderer_accel_edited" object="KeybindingsListStore" swapped="yes"/>
<object class="GtkTreeViewColumn" id="treeviewcolumn3">
<property name="title" translatable="yes">Keybinding</property>
<child>
<object class="GtkCellRendererAccel" id="cellrendereraccel1">
<property name="editable">True</property>
<property name="accel-mode">other</property>
<signal name="accel-cleared" handler="on_cellrenderer_accel_cleared" object="KeybindingsListStore" swapped="yes"/>
<signal name="accel-edited" handler="on_cellrenderer_accel_edited" object="KeybindingsListStore" swapped="yes"/>
</object>
<attributes>
<attribute name="accel-key">2</attribute>
<attribute name="accel-mods">3</attribute>
</attributes>
</child>
</object>
<attributes>
<attribute name="accel-key">2</attribute>
<attribute name="accel-mods">3</attribute>
</attributes>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
Expand Down
15 changes: 15 additions & 0 deletions terminatorlib/prefseditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,10 @@ def on_palette_click(event, data, widget=widget):
widget.set_value(float(self.config['inactive_color_offset']))
widget = guiget('inactive_color_offset_value_label')
widget.set_text('%d%%' % (int(float(self.config['inactive_color_offset'])*100)))
widget = guiget('inactive_bg_color_offset')
widget.set_value(float(self.config['inactive_bg_color_offset']))
widget = guiget('inactive_bg_color_offset_value_label')
widget.set_text('%d%%' % (int(float(self.config['inactive_bg_color_offset'])*100)))
# Open links with a single click (instead of a Ctrl-left click)
widget = guiget('link_single_click')
widget.set_active(self.config['link_single_click'])
Expand Down Expand Up @@ -1294,6 +1298,17 @@ def on_inactive_color_offset_value_changed(self, widget):
label_widget = guiget('inactive_color_offset_value_label')
label_widget.set_text('%d%%' % (int(value * 100)))

def on_inactive_bg_color_offset_value_changed(self, widget):
"""Inactive background color offset setting changed"""
value = widget.get_value() # This one is rounded according to the UI.
if value > 1.0:
value = 1.0
self.config['inactive_bg_color_offset'] = value
self.config.save()
guiget = self.builder.get_object
label_widget = guiget('inactive_bg_color_offset_value_label')
label_widget.set_text('%d%%' % (int(value * 100)))

def on_handlesize_value_changed(self, widget):
"""Handle size changed"""
value = widget.get_value() # This one is rounded according to the UI.
Expand Down
Loading