Improve UI, add options to set toolbar icon size.
[lxde/lxappearance.git] / src / other.c
1 // other.c
2 //
3 // Copyright 2010 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 // MA 02110-1301, USA.
19
20
21 #include "lxappearance2.h"
22 #include "other.h"
23 #include <glib/gi18n.h>
24
25 static void on_tb_style_changed(GtkComboBox* combo, gpointer user_data)
26 {
27 app.toolbar_style = gtk_combo_box_get_active(combo) + GTK_TOOLBAR_ICONS;
28 lxappearance_changed();
29 }
30
31 static void on_tb_icon_size_changed(GtkComboBox* combo, gpointer user_data)
32 {
33 app.toolbar_icon_size = gtk_combo_box_get_active(combo) + GTK_ICON_SIZE_MENU;
34 lxappearance_changed();
35 }
36
37 void other_init(GtkBuilder* b)
38 {
39 int idx;
40 app.tb_style_combo = GTK_WIDGET(gtk_builder_get_object(b, "tb_style"));
41 idx = app.toolbar_style - GTK_TOOLBAR_ICONS;
42 gtk_combo_box_set_active(GTK_COMBO_BOX(app.tb_style_combo), idx);
43 g_signal_connect(app.tb_style_combo, "changed", G_CALLBACK(on_tb_style_changed), NULL);
44
45 app.tb_icon_size_combo = GTK_WIDGET(gtk_builder_get_object(b, "tb_icon_size"));
46 idx = app.toolbar_icon_size - GTK_ICON_SIZE_MENU;
47 gtk_combo_box_set_active(GTK_COMBO_BOX(app.tb_icon_size_combo), idx);
48 g_signal_connect(app.tb_icon_size_combo, "changed", G_CALLBACK(on_tb_icon_size_changed), NULL);
49 }
50