lets just be good and make button icons size based on text size.

shoudl do this theme-wide, but will do that on a theme revamp.



SVN revision: 74999
This commit is contained in:
Carsten Haitzler 2012-08-08 08:56:10 +00:00
parent 2859fb07e5
commit 1d2bb2a5e1
1 changed files with 204 additions and 36 deletions

View File

@ -160,6 +160,39 @@ group { name: "elm/button/base/default";
visible: 1;
}
}
// used to force sizing of icon to follow label sizing nearby
part { name: "sizer.content"; type: TEXT;
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
visible: 0;
text {
font: "Sans,Edje-Vera";
size: 10;
min: 0 0;
text_class: "button";
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
rel1.to: "elm.swallow.content";
rel2.to: "elm.swallow.content";
text {
min: 1 1;
text: "M";
}
}
description { state: "icononly" 0.0;
inherit: "default" 0.0;
rel1.to: "elm.swallow.content";
rel2.to: "elm.swallow.content";
text {
min: 1 1;
text: "M";
}
}
}
// end sizer
}
programs {
program {
@ -230,8 +263,10 @@ group { name: "elm/button/base/default";
new st[31];
new Float:vl;
get_state(PART:"elm.swallow.content", st, 30, vl);
if (!strcmp(st, "icononly"))
set_state(PART:"elm.swallow.content", "visible", 0.0);
if (!strcmp(st, "icononly")) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
set_state(PART:"sizer.content", "visible", 0.0);
}
get_state(PART:"elm.text", st, 30, vl);
if (!strcmp(st, "disabled") || (!strcmp(st, "disabled_visible")))
set_state(PART:"elm.text", "disabled_visible", 0.0);
@ -246,8 +281,10 @@ group { name: "elm/button/base/default";
new st[31];
new Float:vl;
get_state(PART:"elm.swallow.content", st, 30, vl);
if (!strcmp(st, "visible"))
set_state(PART:"elm.swallow.content", "icononly", 0.0);
if (!strcmp(st, "visible")) {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
set_state(PART:"sizer.content", "icononly", 0.0);
}
set_state(PART:"elm.text", "default", 0.0);
get_state(PART:"elm.text", st, 30, vl);
if (!strcmp(st, "default") || (!strcmp(st, "visible")))
@ -263,10 +300,14 @@ group { name: "elm/button/base/default";
new st[31];
new Float:vl;
get_state(PART:"elm.text", st, 30, vl);
if (!strcmp(st, "visible"))
set_state(PART:"elm.swallow.content", "visible", 0.0);
else
set_state(PART:"elm.swallow.content", "icononly", 0.0);
if (!strcmp(st, "visible")) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
set_state(PART:"sizer.content", "visible", 0.0);
}
else {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
set_state(PART:"sizer.content", "icononly", 0.0);
}
}
}
program { name: "icon_hide";
@ -274,6 +315,7 @@ group { name: "elm/button/base/default";
source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.content";
target: "sizer.content";
}
program { name: "disable";
signal: "elm,state,disabled";
@ -500,6 +542,39 @@ group { name: "elm/button/base/hoversel_vertical/default";
visible: 1;
}
}
// used to force sizing of icon to follow label sizing nearby
part { name: "sizer.content"; type: TEXT;
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
visible: 0;
text {
font: "Sans,Edje-Vera";
size: 10;
min: 0 0;
text_class: "button";
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
rel1.to: "elm.swallow.content";
rel2.to: "elm.swallow.content";
text {
min: 1 1;
text: "M";
}
}
description { state: "icononly" 0.0;
inherit: "default" 0.0;
rel1.to: "elm.swallow.content";
rel2.to: "elm.swallow.content";
text {
min: 1 1;
text: "M";
}
}
}
// end sizer
}
programs {
program {
@ -544,8 +619,10 @@ group { name: "elm/button/base/hoversel_vertical/default";
new st[31];
new Float:vl;
get_state(PART:"elm.swallow.content", st, 30, vl);
if (!strcmp(st, "icononly"))
set_state(PART:"elm.swallow.content", "visible", 0.0);
if (!strcmp(st, "icononly")) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
set_state(PART:"sizer.content", "visible", 0.0);
}
set_state(PART:"elm.text", "visible", 0.0);
}
}
@ -556,8 +633,10 @@ group { name: "elm/button/base/hoversel_vertical/default";
new st[31];
new Float:vl;
get_state(PART:"elm.swallow.content", st, 30, vl);
if (!strcmp(st, "visible"))
set_state(PART:"elm.swallow.content", "icononly", 0.0);
if (!strcmp(st, "visible")) {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
set_state(PART:"sizer.content", "icononly", 0.0);
}
set_state(PART:"elm.text", "default", 0.0);
}
}
@ -568,10 +647,14 @@ group { name: "elm/button/base/hoversel_vertical/default";
new st[31];
new Float:vl;
get_state(PART:"elm.text", st, 30, vl);
if (!strcmp(st, "visible"))
set_state(PART:"elm.swallow.content", "visible", 0.0);
else
set_state(PART:"elm.swallow.content", "icononly", 0.0);
if (!strcmp(st, "visible")) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
set_state(PART:"sizer.content", "visible", 0.0);
}
else {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
set_state(PART:"sizer.content", "icononly", 0.0);
}
}
}
program { name: "icon_hide";
@ -579,6 +662,7 @@ group { name: "elm/button/base/hoversel_vertical/default";
source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.content";
target: "sizer.content";
}
program { name: "disable";
signal: "elm,state,disabled";
@ -596,9 +680,9 @@ group { name: "elm/button/base/hoversel_vertical/default";
new Float:vl;
get_state(PART:"elm.text", st, 30, vl);
if (!strcmp(st, "visible"))
set_state(PART:"elm.text", "disabled_visible", 0.0);
set_state(PART:"elm.text", "disabled_visible", 0.0);
else
set_state(PART:"elm.text", "disabled", 0.0);
set_state(PART:"elm.text", "disabled", 0.0);
}
}
program { name: "enable";
@ -617,9 +701,9 @@ group { name: "elm/button/base/hoversel_vertical/default";
new Float:vl;
get_state(PART:"elm.text", st, 30, vl);
if (!strcmp(st, "disabled_visible"))
set_state(PART:"elm.text", "visible", 0.0);
set_state(PART:"elm.text", "visible", 0.0);
else
set_state(PART:"elm.text", "default", 0.0);
set_state(PART:"elm.text", "default", 0.0);
}
}
}
@ -724,6 +808,39 @@ group { name: "elm/button/base/hoversel_vertical_entry/default";
color: 0 0 0 0;
}
}
// used to force sizing of icon to follow label sizing nearby
part { name: "sizer.content"; type: TEXT;
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
visible: 0;
text {
font: "Sans,Edje-Vera";
size: 10;
min: 0 0;
text_class: "button";
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
rel1.to: "elm.swallow.content";
rel2.to: "elm.swallow.content";
text {
min: 1 1;
text: "M";
}
}
description { state: "icononly" 0.0;
inherit: "default" 0.0;
rel1.to: "elm.swallow.content";
rel2.to: "elm.swallow.content";
text {
min: 1 1;
text: "M";
}
}
}
// end sizer
}
programs {
program {
@ -755,8 +872,10 @@ group { name: "elm/button/base/hoversel_vertical_entry/default";
new st[31];
new Float:vl;
get_state(PART:"elm.swallow.content", st, 30, vl);
if (!strcmp(st, "icononly"))
set_state(PART:"elm.swallow.content", "visible", 0.0);
if (!strcmp(st, "icononly")) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
set_state(PART:"sizer.content", "visible", 0.0);
}
set_state(PART:"textvis", "visible", 0.0);
set_state(PART:"elm.text", "visible", 0.0);
}
@ -768,8 +887,10 @@ group { name: "elm/button/base/hoversel_vertical_entry/default";
new st[31];
new Float:vl;
get_state(PART:"elm.swallow.content", st, 30, vl);
if (!strcmp(st, "visible"))
set_state(PART:"elm.swallow.content", "icononly", 0.0);
if (!strcmp(st, "visible")) {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
set_state(PART:"sizer.content", "icononly", 0.0);
}
set_state(PART:"textvis", "default", 0.0);
set_state(PART:"elm.text", "default", 0.0);
}
@ -781,10 +902,14 @@ group { name: "elm/button/base/hoversel_vertical_entry/default";
new st[31];
new Float:vl;
get_state(PART:"textvis", st, 30, vl);
if (!strcmp(st, "visible"))
set_state(PART:"elm.swallow.content", "visible", 0.0);
else
set_state(PART:"elm.swallow.content", "icononly", 0.0);
if (!strcmp(st, "visible")) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
set_state(PART:"sizer.content", "visible", 0.0);
}
else {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
set_state(PART:"sizer.content", "icononly", 0.0);
}
}
}
program { name: "icon_hide";
@ -792,6 +917,7 @@ group { name: "elm/button/base/hoversel_vertical_entry/default";
source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.content";
target: "sizer.content";
}
}
}
@ -970,6 +1096,39 @@ group { name: "elm/button/base/anchor";
visible: 1;
}
}
// used to force sizing of icon to follow label sizing nearby
part { name: "sizer.content"; type: TEXT;
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
visible: 0;
text {
font: "Sans,Edje-Vera";
size: 10;
min: 0 0;
text_class: "button";
}
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
rel1.to: "elm.swallow.content";
rel2.to: "elm.swallow.content";
text {
min: 1 1;
text: "M";
}
}
description { state: "icononly" 0.0;
inherit: "default" 0.0;
rel1.to: "elm.swallow.content";
rel2.to: "elm.swallow.content";
text {
min: 1 1;
text: "M";
}
}
}
// end sizer
}
programs {
program {
@ -1025,8 +1184,10 @@ group { name: "elm/button/base/anchor";
new st[31];
new Float:vl;
get_state(PART:"elm.swallow.content", st, 30, vl);
if (!strcmp(st, "icononly"))
set_state(PART:"elm.swallow.content", "visible", 0.0);
if (!strcmp(st, "icononly")) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
set_state(PART:"sizer.content", "visible", 0.0);
}
get_state(PART:"elm.text", st, 30, vl);
if (!strcmp(st, "disabled") || (!strcmp(st, "disabled_visible")))
set_state(PART:"elm.text", "disabled_visible", 0.0);
@ -1041,8 +1202,10 @@ group { name: "elm/button/base/anchor";
new st[31];
new Float:vl;
get_state(PART:"elm.swallow.content", st, 30, vl);
if (!strcmp(st, "visible"))
set_state(PART:"elm.swallow.content", "icononly", 0.0);
if (!strcmp(st, "visible")) {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
set_state(PART:"sizer.content", "icononly", 0.0);
}
get_state(PART:"elm.text", st, 30, vl);
if (!strcmp(st, "default") || (!strcmp(st, "visible")))
set_state(PART:"elm.text", "default", 0.0);
@ -1057,10 +1220,14 @@ group { name: "elm/button/base/anchor";
new st[31];
new Float:vl;
get_state(PART:"elm.text", st, 30, vl);
if (!strcmp(st, "visible"))
set_state(PART:"elm.swallow.content", "visible", 0.0);
else
set_state(PART:"elm.swallow.content", "icononly", 0.0);
if (!strcmp(st, "visible")) {
set_state(PART:"elm.swallow.content", "visible", 0.0);
set_state(PART:"sizer.content", "visible", 0.0);
}
else {
set_state(PART:"elm.swallow.content", "icononly", 0.0);
set_state(PART:"sizer.content", "icononly", 0.0);
}
}
}
program { name: "icon_hide";
@ -1068,6 +1235,7 @@ group { name: "elm/button/base/anchor";
source: "elm";
action: STATE_SET "default" 0.0;
target: "elm.swallow.content";
target: "sizer.content";
}
program { name: "disable";
signal: "elm,state,disabled";