283
281
private void build_ui ()
285
var main_vbox = new Box (Gtk.Orientation.VERTICAL, 12);
283
var main_vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 12);
286
284
main_vbox.border_width = 12;
287
285
this.add (main_vbox);
289
287
var tabs = new Gtk.Notebook ();
290
var general_tab = new Box (Gtk.Orientation.VERTICAL, 6);
288
var general_tab = new Gtk.Box (Gtk.Orientation.VERTICAL, 6);
291
289
general_tab.border_width = 12;
292
var plugin_tab = new Box (Gtk.Orientation.VERTICAL, 6);
290
var plugin_tab = new Gtk.Box (Gtk.Orientation.VERTICAL, 6);
293
291
plugin_tab.border_width = 12;
294
292
main_vbox.pack_start (tabs);
295
tabs.append_page (general_tab, new Label (_("General")));
296
tabs.append_page (plugin_tab, new Label (_("Plugins")));
293
tabs.append_page (general_tab, new Gtk.Label (_("General")));
294
tabs.append_page (plugin_tab, new Gtk.Label (_("Plugins")));
298
296
/* General Tab */
299
var theme_frame = new Frame (null);
297
var theme_frame = new Gtk.Frame (null);
300
298
theme_frame.set_shadow_type (Gtk.ShadowType.NONE);
301
var theme_frame_label = new Label (null);
299
var theme_frame_label = new Gtk.Label (null);
302
300
theme_frame_label.set_markup (Markup.printf_escaped ("<b>%s</b>", _("Behavior & Look")));
303
301
theme_frame.set_label_widget (theme_frame_label);
305
var behavior_vbox = new Box (Gtk.Orientation.VERTICAL, 6);
306
var align = new Alignment (0.5f, 0.5f, 1.0f, 1.0f);
303
var behavior_vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 6);
304
var align = new Gtk.Alignment (0.5f, 0.5f, 1.0f, 1.0f);
307
305
align.set_padding (6, 12, 12, 12);
308
306
align.add (behavior_vbox);
309
307
theme_frame.add (align);
311
309
/* Select theme combobox row */
312
var row = new Box (Gtk.Orientation.HORIZONTAL, 6);
310
var row = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
313
311
behavior_vbox.pack_start (row, false);
314
var select_theme_label = new Label (_("Theme:"));
312
var select_theme_label = new Gtk.Label (_("Theme:"));
315
313
row.pack_start (select_theme_label, false, false);
316
314
row.pack_end (build_theme_combo (), false, false);
318
316
/* Autostart checkbox */
319
var autostart = new CheckButton.with_label (_("Startup on login"));
317
var autostart = new Gtk.CheckButton.with_label (_("Startup on login"));
320
318
autostart.active = autostart_exists ();
321
319
autostart.toggled.connect (this.autostart_toggled);
322
320
behavior_vbox.pack_start (autostart, false);
324
322
/* Notification icon */
325
var notification = new CheckButton.with_label (_("Show notification icon"));
323
var notification = new Gtk.CheckButton.with_label (_("Show notification icon"));
326
324
notification.active = config.show_indicator;
327
325
notification.toggled.connect ((tb) => {
328
326
config.show_indicator = tb.get_active ();
333
331
general_tab.pack_start (theme_frame, false);
335
333
/* Keybinding treeview */
336
var shortcut_frame = new Frame (null);
334
var shortcut_frame = new Gtk.Frame (null);
337
335
shortcut_frame.set_shadow_type (Gtk.ShadowType.NONE);
338
var shortcut_frame_label = new Label (null);
336
var shortcut_frame_label = new Gtk.Label (null);
339
337
shortcut_frame_label.set_markup (Markup.printf_escaped ("<b>%s</b>", _("Shortcuts")));
340
338
shortcut_frame.set_label_widget (shortcut_frame_label);
341
align = new Alignment (0.5f, 0.5f, 1.0f, 1.0f);
339
align = new Gtk.Alignment (0.5f, 0.5f, 1.0f, 1.0f);
342
340
align.set_padding (6, 12, 12, 12);
344
342
var shortcut_scroll = new Gtk.ScrolledWindow (null, null);
345
shortcut_scroll.set_shadow_type (ShadowType.IN);
346
shortcut_scroll.set_policy (PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
347
var tree_vbox = new Box (Gtk.Orientation.VERTICAL, 6);
343
shortcut_scroll.set_shadow_type (Gtk.ShadowType.IN);
344
shortcut_scroll.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
345
var tree_vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 6);
348
346
Gtk.TreeView treeview = new Gtk.TreeView ();
349
347
tree_vbox.pack_start (shortcut_scroll);
350
348
shortcut_scroll.add (treeview);
355
353
model = new Gtk.ListStore (2, typeof (string), typeof (string));
356
354
treeview.set_model (model);
358
var col = new TreeViewColumn.with_attributes (_("Action"), new CellRendererText (), "text", 0);
356
var col = new Gtk.TreeViewColumn.with_attributes (_("Action"), new Gtk.CellRendererText (), "text", 0);
359
357
treeview.append_column (col);
361
var ren = new CellRendererAccel ();
359
var ren = new Gtk.CellRendererAccel ();
362
360
ren.editable = true;
363
361
ren.accel_mode = Gtk.CellRendererAccelMode.OTHER;
364
362
ren.accel_edited.connect ((a, path, accel_key, accel_mods, keycode) => {
406
var info_box = new Box (Gtk.Orientation.HORIZONTAL, 6);
407
var info_image = new Image.from_stock (Gtk.Stock.INFO, IconSize.MENU);
404
var info_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
405
var info_image = new Gtk.Image.from_stock (Gtk.Stock.INFO, Gtk.IconSize.MENU);
408
406
info_box.pack_start (info_image, false);
409
var info_label = new Label (Markup.printf_escaped ("<span size=\"small\">%s</span>",
407
var info_label = new Gtk.Label (Markup.printf_escaped ("<span size=\"small\">%s</span>",
410
408
_("Click the shortcut you wish to change and press the new shortcut.")));
411
409
info_label.set_use_markup(true);
412
410
info_label.set_alignment (0.0f, 0.5f);