rage browser mode and ui - slicken between desktop and fullscreen mode

so now sizing and count and spacing of items change, header
sizes/style change and more when switching to/from fullscreen mode.
fullscreen == "i want to be a media cener now on a big screen tv" vs
"i'm a video collection browser in a window on your desktop". far
nicer now. i think this is getting close to another release. maybe
after 1.18
This commit is contained in:
Carsten Haitzler 2016-08-06 13:37:54 +09:00
parent 4780a4b07a
commit d0732ec3f1
5 changed files with 126 additions and 14 deletions

View File

@ -1953,24 +1953,47 @@ collections {
description { state: "default" 0.0;
fixed: 0 1;
align: 0.0 0.0;
rel1.offset: 0 40;
rel2.offset: -1 40;
rel1.offset: 0 10;
rel2.offset: -1 10;
rel2.relative: 1.0 0.0;
color: 255 255 255 255;
text { font: "Sans:style=Bold"; size: 40;
text { font: "Sans:style=Bold"; size: 10;
align: 0.0 0.0;
min: 0 1;
elipsis: 0;
}
}
description { state: "fullscreen" 0.0;
inherit: "default" 0.0;
rel1.offset: 0 40;
rel2.offset: -1 40;
text.size: 40;
}
}
part { name: "rage.content"; type: SWALLOW;
description { state: "default" 0.0;
rel1.to_y: "rage.title";
rel1.relative: 0.0 1.0;
rel1.offset: 0 40;
rel2.offset: -1 -41;
rel1.offset: 0 10;
rel2.offset: -1 -1;
}
description { state: "fullscreen" 0.0;
inherit: "default" 0.0;
rel1.offset: 0 40;
rel2.offset: -1 -11;
}
}
}
programs {
program { signal: "state,fullscreen"; source: "rage";
action: STATE_SET "fullscreen" 0.0;
target: "rage.title";
target: "rage.content";
}
program { signal: "state,normal"; source: "rage";
action: STATE_SET "default" 0.0;
target: "rage.title";
target: "rage.content";
}
}
}
@ -1981,6 +2004,9 @@ collections {
styles {
style { name: "browser_item_label";
base: "font=Sans font_size=10 color=#ffffffff wrap=mixed ellipsis=1.0";
}
style { name: "browser_item_label_fullscreen";
base: "font=Sans font_size=20 color=#ffffffff wrap=mixed ellipsis=1.0";
}
}
@ -2044,18 +2070,26 @@ collections {
description { state: "default" 0.0;
rel2.relative: 0.0 0.0;
align: 0.0 0.0;
min: 16 16;
min: 8 8;
fixed: 1 1;
}
description { state: "fullscreen" 0.0;
inherit: "default" 0.0;
min: 16 16;
}
}
part { name: "p2"; type: SPACER;
scale: 1;
description { state: "default" 0.0;
rel1.relative: 1.0 1.0;
align: 1.0 1.0;
min: 16 16;
min: 8 8;
fixed: 1 1;
}
description { state: "fullscreen" 0.0;
inherit: "default" 0.0;
min: 16 16;
}
}
part { name: "clip"; type: RECT;
description { state: "default" 0.0;
@ -2092,9 +2126,9 @@ collections {
description { state: "default" 0.0;
fixed: 1 1;
align: 0.0 1.0;
rel1.offset: 8 8;
rel1.offset: 2 2;
rel1.to: "clip";
rel2.offset: -9 -9;
rel2.offset: -3 -3;
rel2.to: "clip";
color: 255 255 255 255;
text { font: "Sans"; size: 20;
@ -2104,6 +2138,12 @@ collections {
elipsis: 0;
}
}
description { state: "fullscreen" 0.0;
inherit: "default" 0.0;
rel1.offset: 8 8;
rel2.offset: -9 -9;
text.style: "browser_item_label_fullscreen";
}
}
part { name: "event"; type: RECT;
ignore_flags: ON_HOLD;
@ -2116,5 +2156,19 @@ collections {
action: SIGNAL_EMIT "rage,selected" "rage";
}
}
programs {
program { signal: "state,fullscreen"; source: "rage";
action: STATE_SET "fullscreen" 0.0;
target: "rage.title";
target: "p1";
target: "p2";
}
program { signal: "state,normal"; source: "rage";
action: STATE_SET "default" 0.0;
target: "rage.title";
target: "p1";
target: "p2";
}
}
}
}

View File

@ -5,6 +5,7 @@
#include "browser.h"
#include "videothumb.h"
#include "key.h"
#include "dnd.h"
typedef struct _Message Message;
typedef struct _Entry Entry;
@ -48,6 +49,7 @@ static Evas_Object *bx = NULL;
static Evas_Object *sc, *bt;
static Ecore_Thread *fill_thread = NULL;
static Entry *dir_entry = NULL;
static Eina_List *entries = NULL;
static void _sel_go(Evas_Object *win EINA_UNUSED, Entry *base_entry, int x, int y);
@ -58,8 +60,16 @@ _item_size_get(Evas_Object *win, Evas_Coord *w, Evas_Coord *h)
elm_coords_finger_size_adjust(1, &sz, 1, &sz);
evas_object_geometry_get(win, NULL, NULL, w, h);
*w = (double)(*w) / 5.0;
*h = (double)(*h) / 1.5;
if (elm_win_fullscreen_get(win))
{
*w = (double)(*w) / 5.0;
*h = (double)(*h) / 1.5;
}
else
{
*w = (double)(*w) / 8.0;
*h = (double)(*h) / 3.0;
}
if (*w < sz) *w = sz;
if (*h < sz) *h = sz;
}
@ -254,6 +264,10 @@ _entry_files_pop(Evas_Object *win, Entry *entry)
elm_object_focus_allow_set(o, EINA_FALSE);
snprintf(buf, sizeof(buf), "%s/themes/default.edj", elm_app_data_dir_get());
elm_layout_file_set(o, buf, "rage/browser/item");
if (elm_win_fullscreen_get(win))
elm_layout_signal_emit(base, "state,fullscreen", "rage");
else
elm_layout_signal_emit(base, "state,normal", "rage");
snprintf(buf, sizeof(buf), "%s", file);
p = strrchr(buf, '.');
if (p) *p = 0;
@ -332,6 +346,11 @@ _entry_files_redo(Evas_Object *win, Entry *entry)
eina_lock_take(&(entry->lock));
if (elm_win_fullscreen_get(win))
elm_layout_signal_emit(entry->base, "state,fullscreen", "rage");
else
elm_layout_signal_emit(entry->base, "state,normal", "rage");
num = eina_list_count(entry->files);
evas_object_geometry_get(win, NULL, NULL, &ww, &wh);
evas_object_geometry_get(entry->table, &x, &y, &w, &h);
@ -441,6 +460,10 @@ _fill_feedback(void *data, Ecore_Thread *th, void *msg)
elm_object_focus_allow_set(o, EINA_FALSE);
snprintf(buf, sizeof(buf), "%s/themes/default.edj", elm_app_data_dir_get());
elm_layout_file_set(o, buf, "rage/browser/entry");
if (elm_win_fullscreen_get(win))
elm_layout_signal_emit(entry->base, "state,fullscreen", "rage");
else
elm_layout_signal_emit(entry->base, "state,normal", "rage");
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
@ -479,6 +502,7 @@ _fill_feedback(void *data, Ecore_Thread *th, void *msg)
evas_object_show(entry->base);
}
}
entries = eina_list_append(entries, entry);
eina_lock_release(&(entry->lock));
}
else if ((message->type == TYPE_FINISH) && (entry->parent))
@ -516,6 +540,7 @@ _entry_free(Entry *entry)
eina_lock_release(&(entry->lock));
eina_lock_free(&(entry->lock));
if (entry == selentry) selentry = NULL;
entries = eina_list_remove(entries, entry);
free(entry);
}
@ -822,6 +847,7 @@ browser_show(Evas_Object *win)
bx = elm_box_add(win);
sc = elm_scroller_add(win);
dnd_init(win, sc);
elm_object_style_set(sc, "noclip");
elm_object_focus_allow_set(sc, EINA_FALSE);
evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@ -890,8 +916,30 @@ browser_toggle(Evas_Object *win)
}
void
browser_size_update(Evas_Object *win EINA_UNUSED)
browser_size_update(Evas_Object *win)
{
Inf *inf = evas_object_data_get(win, "inf");
Eina_List *l;
Entry *entry;
if (!inf) return;
if (!bx) return;
// XXX: unpop + repop
EINA_LIST_FOREACH(entries, l, entry)
{
_cb_entry_table_move(entry, evas_object_evas_get(entry->table),
entry->table, NULL);
}
}
void
browser_fullscreen(Evas_Object *win, EINA_UNUSED Eina_Bool enabled)
{
Inf *inf = evas_object_data_get(win, "inf");
Eina_List *l;
Entry *entry;
if (!inf) return;
if (!bx) return;
EINA_LIST_FOREACH(entries, l, entry)
{
_entry_files_redo(win, entry);
}
}

View File

@ -5,5 +5,6 @@ void browser_show(Evas_Object *win);
void browser_hide(Evas_Object *win);
void browser_toggle(Evas_Object *win);
void browser_size_update(Evas_Object *win);
void browser_fullscreen(Evas_Object *win, Eina_Bool enabled);
#endif

View File

@ -6,6 +6,7 @@
#include "winvid.h"
#include "winlist.h"
#include "dnd.h"
#include "browser.h"
static int pending_dir = 0;
static Eina_List *playlist = NULL;
@ -46,6 +47,7 @@ _dnd_finish(Evas_Object *win)
win_video_next(win);
win_list_content_update(win);
browser_hide(win);
end:
pending_dir = 0;

View File

@ -18,6 +18,7 @@ _cb_fullscreen(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED
elm_layout_signal_emit(inf->lay, "state,win,fullscreen", "rage");
elm_win_noblank_set(obj, EINA_TRUE);
evas_object_show(inf->event2);
browser_fullscreen(obj, EINA_TRUE);
}
static void
@ -29,6 +30,7 @@ _cb_unfullscreen(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUS
elm_layout_signal_emit(inf->lay, "state,win,normal", "rage");
elm_win_noblank_set(obj, EINA_FALSE);
evas_object_hide(inf->event2);
browser_fullscreen(obj, EINA_FALSE);
}
}
@ -114,8 +116,13 @@ _cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
Evas_Event_Mouse_Down *ev = event_info;
Inf *inf = evas_object_data_get(data, "inf");
if (ev->button != 1) return;
if (!inf) return;
if (ev->button == 3)
{
elm_layout_signal_emit(inf->lay, "about,show", "rage");
return;
}
if (ev->button != 1) return;
if (inf->down) return;
inf->down = EINA_TRUE;
inf->down_x = ev->canvas.x;