forked from enlightenment/edi
Revert "theme: "finish" settings for the theme translucency/shininig"
This reverts commit c3fe0295fc
.
This commit is contained in:
parent
c3fe0295fc
commit
201318adaf
|
@ -273,7 +273,6 @@ _edi_config_init(void)
|
|||
EDI_CONFIG_VAL(D, T, font.name, EET_T_STRING);
|
||||
EDI_CONFIG_VAL(D, T, font.size, EET_T_INT);
|
||||
EDI_CONFIG_VAL(D, T, gui.translucent, EET_T_UCHAR);
|
||||
EDI_CONFIG_VAL(D, T, gui.alpha, EET_T_INT);
|
||||
EDI_CONFIG_VAL(D, T, gui.theme, EET_T_STRING);
|
||||
EDI_CONFIG_VAL(D, T, gui.width, EET_T_INT);
|
||||
EDI_CONFIG_VAL(D, T, gui.height, EET_T_INT);
|
||||
|
@ -507,8 +506,7 @@ _edi_project_config_load()
|
|||
|
||||
/* setup defaults */
|
||||
IFPCFG(0x0001);
|
||||
_edi_project_config->gui.translucent = EINA_FALSE;
|
||||
_edi_project_config->gui.alpha = 255;
|
||||
_edi_project_config->gui.translucent = EINA_TRUE;
|
||||
_edi_project_config->gui.width = 640;
|
||||
_edi_project_config->gui.height = 480;
|
||||
_edi_project_config->gui.leftsize = 0.25;
|
||||
|
|
|
@ -79,7 +79,6 @@ struct _Edi_Project_Config
|
|||
struct
|
||||
{
|
||||
Eina_Bool translucent;
|
||||
int alpha;
|
||||
const char *theme;
|
||||
int width, height, bottomtab;
|
||||
double leftsize, bottomsize;
|
||||
|
|
|
@ -8,12 +8,10 @@
|
|||
|
||||
#include <Ecore_Getopt.h>
|
||||
#include <Elementary.h>
|
||||
#include <Efl_Ui.h>
|
||||
#include <Eio.h>
|
||||
|
||||
#include "Edi.h"
|
||||
#include "edi_config.h"
|
||||
#include "edi_theme.h"
|
||||
#include "edi_filepanel.h"
|
||||
#include "edi_file.h"
|
||||
#include "edi_logpanel.h"
|
||||
|
@ -1474,11 +1472,6 @@ _win_delete_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
|
|||
edi_close();
|
||||
}
|
||||
|
||||
Evas_Object *edi_main_win_get(void)
|
||||
{
|
||||
return _edi_main_win;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
edi_open(const char *inputpath)
|
||||
{
|
||||
|
@ -1515,8 +1508,6 @@ edi_open(const char *inputpath)
|
|||
elm_win_resize_object_add(win, hbx);
|
||||
evas_object_show(hbx);
|
||||
|
||||
edi_theme_window_alpha_set();
|
||||
|
||||
tb = edi_toolbar_setup(hbx);
|
||||
elm_box_pack_start(hbx, tb);
|
||||
_edi_toolbar = tb;
|
||||
|
|
|
@ -48,8 +48,6 @@ extern int EDI_EVENT_FILE_SAVED;
|
|||
|
||||
Eina_Bool edi_open(const char *path);
|
||||
|
||||
Evas_Object *edi_main_win_get(void);
|
||||
|
||||
void edi_close();
|
||||
|
||||
void edi_open_url();
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#endif
|
||||
|
||||
#include <Elementary.h>
|
||||
#include <Efl_Ui.h>
|
||||
|
||||
#include "Edi.h"
|
||||
#include "edi_theme.h"
|
||||
|
@ -15,41 +14,13 @@ static Eina_List *_edi_themes = NULL;
|
|||
// we are hooking into Efl for now...
|
||||
Efl_Ui_Theme_Apply efl_ui_widget_theme_apply(Eo *obj);
|
||||
|
||||
void
|
||||
edi_theme_window_alpha_set(void)
|
||||
{
|
||||
Evas_Object *win;
|
||||
Eina_Bool enabled = _edi_project_config->gui.translucent;
|
||||
|
||||
win = edi_main_win_get();
|
||||
|
||||
elm_win_alpha_set(win, enabled);
|
||||
efl_gfx_color_set(efl_part(win, "background"), 64, 64, 64, _edi_project_config->gui.alpha);
|
||||
}
|
||||
|
||||
void edi_theme_elm_code_alpha_set(Evas_Object *obj)
|
||||
{
|
||||
edi_theme_window_alpha_set();
|
||||
|
||||
if (_edi_project_config->gui.translucent)
|
||||
evas_object_color_set(obj, 255, 255, 255, 1);
|
||||
else
|
||||
evas_object_color_set(obj, 255, 255, 255, 255);
|
||||
|
||||
edi_theme_window_alpha_set();
|
||||
if (_edi_project_config->gui.translucent)
|
||||
elm_code_widget_alpha_set(obj, _edi_project_config->gui.alpha);
|
||||
else
|
||||
elm_code_widget_alpha_set(obj, 255);
|
||||
}
|
||||
|
||||
void
|
||||
edi_theme_elm_code_set(Evas_Object *obj, const char *name)
|
||||
{
|
||||
Eina_List *l;
|
||||
Edi_Theme *theme;
|
||||
|
||||
if (!obj || !name)
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
edi_theme_themes_get();
|
||||
|
@ -62,7 +33,6 @@ edi_theme_elm_code_set(Evas_Object *obj, const char *name)
|
|||
elm_layout_file_set(obj, theme->path, "elm/code/layout/default");
|
||||
efl_ui_widget_theme_apply(obj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Edi_Theme *
|
||||
|
|
|
@ -57,9 +57,7 @@ Eina_List *edi_theme_themes_get(void);
|
|||
*/
|
||||
Edi_Theme *edi_theme_theme_by_name(const char *name);
|
||||
|
||||
void edi_theme_window_alpha_set(void);
|
||||
|
||||
void edi_theme_elm_code_alpha_set(Evas_Object *obj);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -1307,7 +1307,6 @@ _edi_editor_config_changed(void *data, int type EINA_UNUSED, void *event EINA_UN
|
|||
code->config.trim_whitespace = _edi_config->trim_whitespace;
|
||||
|
||||
elm_obj_code_widget_font_set(widget, _edi_project_config->font.name, _edi_project_config->font.size);
|
||||
edi_theme_elm_code_alpha_set(widget);
|
||||
edi_theme_elm_code_set(widget, _edi_project_config->gui.theme);
|
||||
elm_obj_code_widget_show_whitespace_set(widget, _edi_project_config->gui.show_whitespace);
|
||||
elm_obj_code_widget_tab_inserts_spaces_set(widget, _edi_project_config->gui.tab_inserts_spaces);
|
||||
|
|
|
@ -297,7 +297,6 @@ _edi_mainview_split_config_changed_cb(void *data, int type EINA_UNUSED, void *ev
|
|||
Elm_Code_Widget *widget = data;
|
||||
|
||||
elm_code_widget_font_set(widget, _edi_project_config->font.name, _edi_project_config->font.size);
|
||||
edi_theme_elm_code_alpha_set(widget);
|
||||
edi_theme_elm_code_set(widget, _edi_project_config->gui.theme);
|
||||
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
|
|
|
@ -108,19 +108,6 @@ _edi_settings_toolbar_hidden_cb(void *data EINA_UNUSED, Evas_Object *obj,
|
|||
_edi_project_config_save();
|
||||
}
|
||||
|
||||
static void
|
||||
_edi_settings_translucent_state_cb(void *data EINA_UNUSED, Evas_Object *obj,
|
||||
void *event EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *check = obj;
|
||||
int state = elm_check_state_get(check);
|
||||
|
||||
_edi_project_config->gui.translucent = state;
|
||||
_edi_project_config_save();
|
||||
|
||||
elm_object_disabled_set((Evas_Object *) data, !state);
|
||||
}
|
||||
|
||||
static void
|
||||
_edi_settings_font_choose_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
@ -186,19 +173,11 @@ _edi_settings_display_theme_text_get_cb(void *data, Evas_Object *obj EINA_UNUSED
|
|||
return strdup(current->title);
|
||||
}
|
||||
|
||||
static void
|
||||
_edi_settings_display_alpha_changed_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
||||
_edi_project_config->gui.alpha = elm_slider_value_get(obj);
|
||||
_edi_project_config_save();
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_edi_settings_display_create(Evas_Object *parent)
|
||||
{
|
||||
Evas_Object *box, *hbox, *frame, *label, *spinner, *check, *button, *preview;
|
||||
Evas_Object *table, *combobox, *slider;
|
||||
Evas_Object *table, *combobox;
|
||||
Elm_Genlist_Item_Class *itc;
|
||||
Edi_Theme *theme;
|
||||
Eina_List *themes, *l;
|
||||
|
@ -237,7 +216,7 @@ _edi_settings_display_create(Evas_Object *parent)
|
|||
elm_table_pack(table, label, 0, 1, 1, 1);
|
||||
evas_object_show(label);
|
||||
|
||||
// START OF THEME SELECTOR
|
||||
// START OF COLOR SELECTOR
|
||||
|
||||
combobox = elm_combobox_add(table);
|
||||
evas_object_size_hint_weight_set(combobox, 0.75, 0.0);
|
||||
|
@ -267,50 +246,17 @@ _edi_settings_display_create(Evas_Object *parent)
|
|||
elm_genlist_realized_items_update(combobox);
|
||||
elm_genlist_item_class_free(itc);
|
||||
|
||||
// END OF THEME SELECTOR
|
||||
|
||||
// START OF ALPHA SELECTOR
|
||||
|
||||
slider = elm_slider_add(table);
|
||||
check = elm_check_add(box);
|
||||
elm_check_state_set(check, _edi_project_config->gui.translucent);
|
||||
elm_object_text_set(check, _("Translucent"));
|
||||
evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_table_pack(table, check, 1, 2, 1, 1);
|
||||
evas_object_show(check);
|
||||
evas_object_smart_callback_add(check, "changed",
|
||||
_edi_settings_translucent_state_cb, slider);
|
||||
|
||||
label = elm_label_add(table);
|
||||
elm_object_text_set(label, _("Shine"));
|
||||
evas_object_size_hint_align_set(label, EVAS_HINT_EXPAND, 0.5);
|
||||
elm_table_pack(table, label, 0, 3, 1, 1);
|
||||
evas_object_show(label);
|
||||
|
||||
elm_object_disabled_set(slider, !_edi_project_config->gui.translucent);
|
||||
evas_object_size_hint_align_set(slider, EVAS_HINT_FILL, 0.5);
|
||||
evas_object_size_hint_weight_set(slider, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_slider_min_max_set(slider, 0, 255);
|
||||
elm_slider_value_set(slider, _edi_project_config->gui.alpha);
|
||||
elm_slider_span_size_set(slider, 255);
|
||||
elm_slider_step_set(slider, 1);
|
||||
elm_slider_indicator_format_set(slider, "%1.0f");
|
||||
elm_table_pack(table, slider, 1, 3, 1, 1);
|
||||
evas_object_show(slider);
|
||||
evas_object_smart_callback_add(slider, "delay,changed", _edi_settings_display_alpha_changed_cb, NULL);
|
||||
|
||||
// END OF ALPHA SELECTOR
|
||||
// END OF COLOR SELECTOR
|
||||
|
||||
check = elm_check_add(box);
|
||||
elm_object_text_set(check, _("Display whitespace"));
|
||||
elm_check_state_set(check, _edi_project_config->gui.show_whitespace);
|
||||
elm_box_pack_end(box, check);
|
||||
evas_object_show(check);
|
||||
evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(check, 0.0, 0.5);
|
||||
evas_object_smart_callback_add(check, "changed",
|
||||
_edi_settings_display_whitespace_cb, NULL);
|
||||
evas_object_show(check);
|
||||
|
||||
hbox = elm_box_add(box);
|
||||
elm_box_horizontal_set(hbox, EINA_TRUE);
|
||||
|
|
Loading…
Reference in New Issue