Skip to content

Commit

Permalink
Merge pull request #561 from Vulcalien/cell-width-preferences
Browse files Browse the repository at this point in the history
Fix: handle_size treated as cell_width
  • Loading branch information
mattrose committed Dec 26, 2021
2 parents acbaee0 + 3c57502 commit ca335e4
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 83 deletions.
2 changes: 1 addition & 1 deletion terminatorlib/config.py
Expand Up @@ -113,8 +113,8 @@
'disable_mouse_paste' : False,
'smart_copy' : True,
'clear_select_on_copy' : False,
'cell_height' : 1.0,
'cell_width' : 1.0,
'cell_height' : 1.0,
'case_sensitive' : True,
'invert_search' : False,
'link_single_click' : False,
Expand Down
134 changes: 57 additions & 77 deletions terminatorlib/preferences.glade
Expand Up @@ -954,40 +954,29 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="cell_height_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Cell Height:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkScale" id="cellheight">
<object class="GtkScale" id="inactive_color_offset">
<property name="width-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="halign">baseline</property>
<property name="hexpand">True</property>
<property name="adjustment">adjustment_cellheight</property>
<property name="round-digits">1</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_cellheight_value_changed" swapped="no"/>
<signal name="value-changed" handler="on_inactive_color_offset_value_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">4</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="cellheight_value_label">
<object class="GtkLabel" id="handlesize_value_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label">1.0</property>
<property name="label">-1</property>
<property name="justify">right</property>
<property name="width-chars">5</property>
<property name="max-width-chars">5</property>
Expand All @@ -996,60 +985,56 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkScale" id="handlewidth">
<property name="width-request">100</property>
<object class="GtkLabel" id="inactive_color_offset_value_label">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="halign">baseline</property>
<property name="hexpand">True</property>
<property name="adjustment">adjustment1</property>
<property name="round-digits">0</property>
<property name="digits">0</property>
<property name="draw-value">False</property>
<property name="value-pos">bottom</property>
<signal name="value-changed" handler="on_handlewidth_value_changed" swapped="no"/>
<property name="can-focus">False</property>
<property name="label">100%</property>
<property name="justify">right</property>
<property name="width-chars">5</property>
<property name="max-width-chars">5</property>
<property name="lines">1</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">1</property>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="cell_width_label">
<object class="GtkCheckButton" id="extrastylingcheck">
<property name="label" translatable="yes">Extra Styling (Theme dependant)</property>
<property name="use-action-appearance">False</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Cell Width:</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="xalign">0</property>
<property name="draw-indicator">True</property>
<signal name="toggled" handler="on_extrastylingcheck_toggled" swapped="no"/>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
<property name="top-attach">0</property>
<property name="width">3</property>
</packing>
</child>
<child>
<object class="GtkScale" id="cellwidth">
<property name="width-request">100</property>
<object class="GtkLabel" id="cell_height_label">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="halign">baseline</property>
<property name="hexpand">True</property>
<property name="adjustment">adjustment_cellwidth</property>
<property name="round-digits">1</property>
<property name="draw-value">False</property>
<property name="value-pos">bottom</property>
<signal name="value-changed" handler="on_handlewidth_value_changed" swapped="no"/>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Cell Height:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="cellwidth_value_label">
<object class="GtkLabel" id="cellheight_value_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label">1.0</property>
Expand All @@ -1065,45 +1050,45 @@
</packing>
</child>
<child>
<object class="GtkScale" id="inactive_color_offset">
<object class="GtkScale" id="cellheight">
<property name="width-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="halign">baseline</property>
<property name="hexpand">True</property>
<property name="adjustment">adjustment7</property>
<property name="round-digits">2</property>
<property name="digits">2</property>
<property name="adjustment">adjustment_cellheight</property>
<property name="round-digits">1</property>
<property name="draw-value">False</property>
<property name="value-pos">bottom</property>
<signal name="value-changed" handler="on_inactive_color_offset_value_changed" swapped="no"/>
<signal name="value-changed" handler="on_cellheight_value_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">2</property>
<property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="handlesize_value_label">
<object class="GtkScale" id="cellwidth">
<property name="width-request">100</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label">-1</property>
<property name="justify">right</property>
<property name="width-chars">5</property>
<property name="max-width-chars">5</property>
<property name="lines">1</property>
<property name="xalign">1</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="adjustment">adjustment_cellwidth</property>
<property name="round-digits">1</property>
<property name="draw-value">False</property>
<property name="value-pos">bottom</property>
<signal name="value-changed" handler="on_cellwidth_value_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
<property name="left-attach">2</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="inactive_color_offset_value_label">
<object class="GtkLabel" id="cellwidth_value_label">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label">100%</property>
<property name="label">1.0</property>
<property name="justify">right</property>
<property name="width-chars">5</property>
<property name="max-width-chars">5</property>
Expand All @@ -1112,24 +1097,19 @@
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="extrastylingcheck">
<property name="label" translatable="yes">Extra Styling (Theme dependant)</property>
<property name="use-action-appearance">False</property>
<object class="GtkLabel" id="cell_width_label">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Cell Width:</property>
<property name="xalign">0</property>
<property name="draw-indicator">True</property>
<signal name="toggled" handler="on_extrastylingcheck_toggled" swapped="no"/>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
<property name="width">3</property>
<property name="top-attach">4</property>
</packing>
</child>
</object>
Expand Down
6 changes: 1 addition & 5 deletions terminatorlib/prefseditor.py
Expand Up @@ -257,19 +257,15 @@ def set_values(self):
widget = guiget('handlesize_value_label')
widget.set_text(str(termsepsize))

#
# Cell Height
#
cellheightsize = self.config['cell_height']
cellheightsize = round(float(cellheightsize),1)
widget = guiget('cellheight')
widget.set_value(cellheightsize)
widget = guiget('cellheight_value_label')
widget.set_text(str(cellheightsize))

#
# Cell Width
#
cellwidthsize = self.config['cell_width']
cellwidthsize = round(float(cellwidthsize),1)
widget = guiget('cellwidth')
Expand Down Expand Up @@ -1278,7 +1274,7 @@ def on_cellheight_value_changed(self, widget):
label_widget = guiget('cellheight_value_label')
label_widget.set_text(str(value))

def on_handlewidth_value_changed(self, widget):
def on_cellwidth_value_changed(self, widget):
"""Handles cell width changed"""
value = widget.get_value()
value = round(float(value), 1)
Expand Down

0 comments on commit ca335e4

Please sign in to comment.