Merge lp:~dechandler10/terminator/fix_custom_commands_dialog into lp:terminator/trunk

Proposed by David Chandler
Status: Merged
Merged at revision: 1532
Proposed branch: lp:~dechandler10/terminator/fix_custom_commands_dialog
Merge into: lp:terminator/trunk
Diff against target: 31 lines (+11/-2)
1 file modified
terminatorlib/plugins/custom_commands.py (+11/-2)
To merge this branch: bzr merge lp:~dechandler10/terminator/fix_custom_commands_dialog
Reviewer Review Type Date Requested Status
Terminator Pending
Review via email: mp+230471@code.launchpad.net

Description of the change

Currently, the TreeView in the Custom Commands dialog will expand to accomodate longer and more commands. This becomes problematic when you have it setup with lots of complex one-liners. This commit sets the box's size and gives it a scrollbar.

To post a comment you must log in.
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

I merged a slightly modified version in revision 1532.

I wasn't keen on the column name-change, the size related lines seemed a bit pointless - the default looked fine by my eyes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'terminatorlib/plugins/custom_commands.py'
2--- terminatorlib/plugins/custom_commands.py 2013-10-29 13:57:01 +0000
3+++ terminatorlib/plugins/custom_commands.py 2014-08-12 12:00:07 +0000
4@@ -146,7 +146,8 @@
5
6 renderer = gtk.CellRendererToggle()
7 renderer.connect('toggled', self.on_toggled, ui)
8- column = gtk.TreeViewColumn("Enabled", renderer, active=CC_COL_ENABLED)
9+ column = gtk.TreeViewColumn("On", renderer, active=CC_COL_ENABLED)
10+ column.set_max_width(30)
11 treeview.append_column(column)
12
13 renderer = gtk.CellRendererText()
14@@ -157,8 +158,16 @@
15 column = gtk.TreeViewColumn("Command", renderer, text=CC_COL_COMMAND)
16 treeview.append_column(column)
17
18+ treeview.columns_autosize()
19+
20 hbox = gtk.HBox()
21- hbox.pack_start(treeview)
22+
23+ scroll_window = gtk.ScrolledWindow()
24+ scroll_window.set_size_request(500, 250)
25+ scroll_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
26+ scroll_window.add_with_viewport(treeview)
27+
28+ hbox.pack_start(scroll_window)
29 dbox.vbox.pack_start(hbox)
30
31 button_box = gtk.VBox()