testing toolbar - figuring out why icon size set didnt work and also

added empty colros config pane, testing vertical toolbar scroll.



SVN revision: 75513
This commit is contained in:
Carsten Haitzler 2012-08-22 03:12:40 +00:00
parent 60cda4bcf3
commit af8667a832
5 changed files with 57 additions and 8 deletions

View File

@ -19,8 +19,9 @@ main.c main.h \
media.c media.h \ media.c media.h \
options.c options.h \ options.c options.h \
options_behavior.c options_behavior.h \ options_behavior.c options_behavior.h \
options_helpers.c options_helpers.h \ options_colors.c options_colors.h \
options_font.c options_font.h \ options_font.c options_font.h \
options_helpers.c options_helpers.h \
options_video.c options_video.h \ options_video.c options_video.h \
options_theme.c options_theme.h \ options_theme.c options_theme.h \
options_wallpaper.c options_wallpaper.h \ options_wallpaper.c options_wallpaper.h \

View File

@ -8,6 +8,7 @@
#include "options_video.h" #include "options_video.h"
#include "options_theme.h" #include "options_theme.h"
#include "options_wallpaper.h" #include "options_wallpaper.h"
#include "options_colors.h"
#include "config.h" #include "config.h"
#include "termio.h" #include "termio.h"
@ -18,49 +19,72 @@ static Eina_Bool op_out = EINA_FALSE;
static Ecore_Timer *op_del_timer = NULL; static Ecore_Timer *op_del_timer = NULL;
static Evas_Object *saved_win = NULL; static Evas_Object *saved_win = NULL;
static Evas_Object *saved_bg = NULL; static Evas_Object *saved_bg = NULL;
static int mode = -1;
static void static void
_cb_op_font(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__) _cb_op_font(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{ {
if (mode == 1) return;
elm_box_clear(op_opbox); elm_box_clear(op_opbox);
options_font(op_opbox, data); options_font(op_opbox, data);
mode = 1;
} }
static void static void
_cb_op_theme(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__) _cb_op_theme(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{ {
if (mode == 2) return;
elm_box_clear(op_opbox); elm_box_clear(op_opbox);
options_theme(op_opbox, data); options_theme(op_opbox, data);
// XXX: not done yet // XXX: not done yet
mode = 2;
} }
static void static void
_cb_op_wallpaper(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__) _cb_op_wallpaper(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{ {
if (mode == 3) return;
elm_box_clear(op_opbox); elm_box_clear(op_opbox);
options_wallpaper(op_opbox, data); options_wallpaper(op_opbox, data);
// XXX: not done yet // XXX: not done yet
mode = 3;
}
static void
_cb_op_colors(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{
if (mode == 4) return;
elm_box_clear(op_opbox);
options_colors(op_opbox, data);
// XXX: not done yet
mode = 4;
} }
static void static void
_cb_op_video(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__) _cb_op_video(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{ {
if (mode == 5) return;
elm_box_clear(op_opbox); elm_box_clear(op_opbox);
options_video(op_opbox, data); options_video(op_opbox, data);
mode = 5;
} }
static void static void
_cb_op_behavior(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__) _cb_op_behavior(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{ {
if (mode == 6) return;
elm_box_clear(op_opbox); elm_box_clear(op_opbox);
options_behavior(op_opbox, data); options_behavior(op_opbox, data);
mode = 6;
} }
static void static void
_cb_op_helpers(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__) _cb_op_helpers(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
{ {
if (mode == 7) return;
elm_box_clear(op_opbox); elm_box_clear(op_opbox);
options_helpers(op_opbox, data); options_helpers(op_opbox, data);
mode = 7;
} }
static void static void
@ -94,6 +118,7 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
saved_win = win; saved_win = win;
saved_bg = bg; saved_bg = bg;
mode = -1;
if (!op_frame) if (!op_frame)
{ {
Elm_Object_Item *it_fn; Elm_Object_Item *it_fn;
@ -123,14 +148,12 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
op_toolbar = o = elm_toolbar_add(win); op_toolbar = o = elm_toolbar_add(win);
evas_object_size_hint_weight_set(o, 0.0, EVAS_HINT_EXPAND); evas_object_size_hint_weight_set(o, 0.0, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, 0.5, 0.0); evas_object_size_hint_align_set(o, 0.5, EVAS_HINT_FILL);
elm_toolbar_horizontal_set(o, EINA_FALSE); elm_toolbar_horizontal_set(o, EINA_FALSE);
elm_object_style_set(o, "item_horizontal"); elm_object_style_set(o, "item_horizontal");
evas_object_size_hint_weight_set(o, 0.0, 0.0);
evas_object_size_hint_align_set(o, 0.5, 0.0);
elm_toolbar_icon_size_set(o, 16); elm_toolbar_icon_size_set(o, 16);
elm_toolbar_shrink_mode_set(o, ELM_TOOLBAR_SHRINK_NONE); elm_toolbar_shrink_mode_set(o, ELM_TOOLBAR_SHRINK_SCROLL);
elm_toolbar_select_mode_set(o, ELM_OBJECT_SELECT_MODE_DEFAULT); elm_toolbar_select_mode_set(o, ELM_OBJECT_SELECT_MODE_ALWAYS);
elm_toolbar_menu_parent_set(o, win); elm_toolbar_menu_parent_set(o, win);
elm_toolbar_homogeneous_set(o, EINA_FALSE); elm_toolbar_homogeneous_set(o, EINA_FALSE);
@ -140,6 +163,8 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
"Theme", _cb_op_theme, term); "Theme", _cb_op_theme, term);
elm_toolbar_item_append(o, "preferences-desktop-wallpaper", elm_toolbar_item_append(o, "preferences-desktop-wallpaper",
"Wallpaper", _cb_op_wallpaper, term); "Wallpaper", _cb_op_wallpaper, term);
elm_toolbar_item_append(o, "preferences-color",
"Colors", _cb_op_colors, term);
elm_toolbar_item_append(o, "preferences-desktop-multimedia", elm_toolbar_item_append(o, "preferences-desktop-multimedia",
"Video", _cb_op_video, term); "Video", _cb_op_video, term);
elm_toolbar_item_append(o, "system-run", elm_toolbar_item_append(o, "system-run",
@ -153,7 +178,7 @@ options_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
elm_toolbar_item_selected_set(it_fn, EINA_TRUE); elm_toolbar_item_selected_set(it_fn, EINA_TRUE);
op_temp = o = elm_check_add(win); op_temp = o = elm_check_add(win);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 1.0); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 1.0);
elm_object_text_set(o, "Temporary"); elm_object_text_set(o, "Temporary");
elm_check_state_set(o, config->temporary); elm_check_state_set(o, config->temporary);

20
src/bin/options_colors.c Normal file
View File

@ -0,0 +1,20 @@
#include "private.h"
#include <Elementary.h>
#include "config.h"
#include "termio.h"
#include "options.h"
#include "options_colors.h"
void
options_colors(Evas_Object *opbox, Evas_Object *term __UNUSED__)
{
Evas_Object *o;
o = elm_label_add(opbox);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_text_set(o, "Not Implemented Yet.");
evas_object_show(o);
elm_box_pack_end(opbox, o);
}

1
src/bin/options_colors.h Normal file
View File

@ -0,0 +1 @@
void options_colors(Evas_Object *opbox, Evas_Object *term);

View File

@ -7,6 +7,8 @@
#include "options_font.h" #include "options_font.h"
#include "utils.h" #include "utils.h"
#define TEST_STRING "oislOIS.015!|,"
static Evas_Object *op_fontslider, *op_fontlist, *op_fsml, *op_fbig; static Evas_Object *op_fontslider, *op_fontlist, *op_fsml, *op_fbig;
typedef struct _Font Font; typedef struct _Font Font;
@ -104,7 +106,7 @@ _cb_op_font_preview_eval(void *data, Evas *e __UNUSED__, Evas_Object *obj, void
{ {
o = evas_object_text_add(evas_object_evas_get(obj)); o = evas_object_text_add(evas_object_evas_get(obj));
evas_object_color_set(o, 0, 0, 0, 255); evas_object_color_set(o, 0, 0, 0, 255);
evas_object_text_text_set(o, "Abc 123 $@#"); evas_object_text_text_set(o, TEST_STRING);
evas_object_scale_set(o, elm_config_scale_get()); evas_object_scale_set(o, elm_config_scale_get());
if (f->bitmap) if (f->bitmap)
{ {