summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-03-24 19:56:01 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-03-24 19:56:01 +0900
commitfa4ebb5b2f07aca0aa226a38e6d6ba9650ef6570 (patch)
tree00176108ee232f3f83dd89a7e857488d26450431 /src
parent72e813bf2ae5d6434e198d0424fc38e7e6405982 (diff)
icons for buttons, theme overlay (for now) and some theme polishingv0.3.0
for terminology sel
Diffstat (limited to 'src')
-rw-r--r--src/bin/controls.c89
-rw-r--r--src/bin/main.c16
2 files changed, 43 insertions, 62 deletions
diff --git a/src/bin/controls.c b/src/bin/controls.c
index 567cd1d..0e4ff86 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -121,6 +121,30 @@ _cb_saved_del(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUS
121 } 121 }
122} 122}
123 123
124static Evas_Object *
125_button_add(Evas_Object *win, const char *label, const char *icon, Evas_Smart_Cb cb, void *cbdata)
126{
127 Evas_Object *o, *bt, *ic;
128
129 bt = o = elm_button_add(win);
130 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
131 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
132 if (label) elm_object_text_set(o, label);
133 evas_object_smart_callback_add(o, "clicked", cb, cbdata);
134
135 if (icon)
136 {
137 ic = o = elm_icon_add(win);
138 evas_object_size_hint_aspect_set(o, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
139 elm_icon_standard_set(o, icon);
140 elm_object_part_content_set(bt, "icon", o);
141 evas_object_show(o);
142 }
143
144 evas_object_show(bt);
145 return bt;
146}
147
124void 148void
125controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term) 149controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
126{ 150{
@@ -150,41 +174,14 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
150 elm_box_pack_end(ct_boxh, o); 174 elm_box_pack_end(ct_boxh, o);
151 evas_object_show(o); 175 evas_object_show(o);
152 176
153 // XXX: need real icon 177 o = _button_add(win, "New", "new", _cb_ct_new, term);
154 o = elm_button_add(win);
155 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
156 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
157 elm_object_text_set(o, "*");
158 elm_box_pack_end(ct_box2, o); 178 elm_box_pack_end(ct_box2, o);
159 evas_object_show(o); 179 o = _button_add(win, "Split V", "split-h", _cb_ct_split_v, term);
160 evas_object_smart_callback_add(o, "clicked", _cb_ct_new, NULL);
161
162 // XXX: need real icon
163 o = elm_button_add(win);
164 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
165 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
166 elm_object_text_set(o, "|");
167 elm_box_pack_end(ct_box2, o); 180 elm_box_pack_end(ct_box2, o);
168 evas_object_show(o); 181 o = _button_add(win, "Split H", "split-v", _cb_ct_split_h, term);
169 evas_object_smart_callback_add(o, "clicked", _cb_ct_split_v, NULL);
170
171 // XXX: need real icon
172 o = elm_button_add(win);
173 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
174 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
175 elm_object_text_set(o, "-");
176 elm_box_pack_end(ct_box2, o); 182 elm_box_pack_end(ct_box2, o);
177 evas_object_show(o); 183 o = _button_add(win, "Close", "close", _cb_ct_close, term);
178 evas_object_smart_callback_add(o, "clicked", _cb_ct_split_h, NULL);
179
180 // XXX: need real icon
181 o = elm_button_add(win);
182 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
183 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
184 elm_object_text_set(o, "X");
185 elm_box_pack_end(ct_box2, o); 184 elm_box_pack_end(ct_box2, o);
186 evas_object_show(o);
187 evas_object_smart_callback_add(o, "clicked", _cb_ct_close, NULL);
188 185
189 o = elm_separator_add(win); 186 o = elm_separator_add(win);
190 evas_object_size_hint_weight_set(o, 0.0, EVAS_HINT_EXPAND); 187 evas_object_size_hint_weight_set(o, 0.0, EVAS_HINT_EXPAND);
@@ -197,21 +194,10 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
197 elm_box_pack_end(ct_boxh, o); 194 elm_box_pack_end(ct_boxh, o);
198 evas_object_show(o); 195 evas_object_show(o);
199 196
200 o = elm_button_add(win); 197 o = _button_add(win, "Copy", "copy", _cb_ct_copy, term);
201 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
202 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
203 elm_object_text_set(o, "Copy");
204 elm_box_pack_end(ct_box, o); 198 elm_box_pack_end(ct_box, o);
205 evas_object_show(o); 199 o = _button_add(win, "Paste", "paste", _cb_ct_paste, term);
206 evas_object_smart_callback_add(o, "clicked", _cb_ct_copy, term);
207
208 o = elm_button_add(win);
209 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
210 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
211 elm_object_text_set(o, "Paste");
212 elm_box_pack_end(ct_box, o); 200 elm_box_pack_end(ct_box, o);
213 evas_object_show(o);
214 evas_object_smart_callback_add(o, "clicked", _cb_ct_paste, term);
215 201
216 o = elm_separator_add(win); 202 o = elm_separator_add(win);
217 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 203 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
@@ -220,13 +206,8 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
220 elm_box_pack_end(ct_box, o); 206 elm_box_pack_end(ct_box, o);
221 evas_object_show(o); 207 evas_object_show(o);
222 208
223 o = elm_button_add(win); 209 o = _button_add(win, "Settings", "settings", _cb_ct_options, term);
224 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
225 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
226 elm_object_text_set(o, "Options");
227 elm_box_pack_end(ct_box, o); 210 elm_box_pack_end(ct_box, o);
228 evas_object_show(o);
229 evas_object_smart_callback_add(o, "clicked", _cb_ct_options, NULL);
230 211
231 o = elm_separator_add(win); 212 o = elm_separator_add(win);
232 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 213 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
@@ -235,14 +216,8 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
235 elm_box_pack_end(ct_box, o); 216 elm_box_pack_end(ct_box, o);
236 evas_object_show(o); 217 evas_object_show(o);
237 218
238 o = elm_button_add(win); 219 o = _button_add(win, "About", "about", _cb_ct_about, term);
239 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
240 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
241 elm_object_text_set(o, "About");
242 elm_box_pack_end(ct_box, o); 220 elm_box_pack_end(ct_box, o);
243 evas_object_show(o);
244 evas_object_smart_callback_add(o, "clicked", _cb_ct_about, NULL);
245
246 } 221 }
247 if (!ct_out) 222 if (!ct_out)
248 { 223 {
diff --git a/src/bin/main.c b/src/bin/main.c
index 441c46c..6d1537b 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -2328,16 +2328,22 @@ elm_main(int argc, char **argv)
2328 return EXIT_FAILURE; 2328 return EXIT_FAILURE;
2329 } 2329 }
2330 2330
2331 config_init();
2332
2333 main_config = config_load("config");
2334 config = config_fork(main_config);
2335
2336 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 2331 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
2337 elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR); 2332 elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
2338 elm_app_compile_data_dir_set(PACKAGE_DATA_DIR); 2333 elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
2339 elm_app_info_set(elm_main, "terminology", "themes/default.edj"); 2334 elm_app_info_set(elm_main, "terminology", "themes/default.edj");
2340 2335
2336 config_init();
2337
2338 main_config = config_load("config");
2339
2340// elm_theme_extension_add(NULL, config_theme_path_get(main_config));
2341// elm_theme_extension_add(NULL, config_theme_path_default_get(main_config));
2342 elm_theme_overlay_add(NULL, config_theme_path_get(main_config));
2343 elm_theme_overlay_add(NULL, config_theme_path_default_get(main_config));
2344
2345 config = config_fork(main_config);
2346
2341 args = ecore_getopt_parse(&options, values, argc, argv); 2347 args = ecore_getopt_parse(&options, values, argc, argv);
2342 if (args < 0) 2348 if (args < 0)
2343 { 2349 {