econnman: improve theme and look and feel.

NOTE: I'm missing few icons from designer, those I've cut from the
mockup while I wait (lock, favorite).



SVN revision: 74866
This commit is contained in:
Gustavo Sverzut Barbieri 2012-08-03 22:09:19 +00:00
parent 9a55bf1967
commit 14074f8808
15 changed files with 77 additions and 184 deletions

View File

@ -39,7 +39,10 @@ data/theme/connman-tech-offline.png \
data/theme/connman-tech-powered.png \
data/theme/connman-wifi-bad.png \
data/theme/connman-wifi-good.png \
data/theme/connman-wifi-medium.png
data/theme/connman-wifi-medium.png \
data/theme/connman-bluetooth.png \
data/theme/connman-cellular.png
themedir = $(pkgdatadir)/theme
theme_DATA = data/theme/default.edj

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 930 B

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -1,63 +1,33 @@
collections {
group {
name: "elm/icon/connman-tech-connected/default";
max: 128 128;
min: 16 16;
parts {
part {
name: "icon";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
aspect_preference: BOTH;
image.image: "connman-tech-connected.png" COMP;
image.normal: "connman-tech-connected.png";
}
}
}
}
group {
name: "elm/icon/connman-tech-powered/default";
max: 128 128;
min: 16 16;
parts {
part {
name: "icon";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
aspect_preference: BOTH;
image.image: "connman-tech-powered.png" COMP;
image.normal: "connman-tech-powered.png";
}
}
}
}
group {
name: "elm/icon/connman-tech-offline/default";
max: 128 128;
min: 16 16;
parts {
part {
name: "icon";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
aspect_preference: BOTH;
image.image: "connman-tech-offline.png" COMP;
image.normal: "connman-tech-offline.png";
}
}
}
#define ICO(name_, file_) \
group { \
name: "elm/icon/"##name_"/default"; \
max: 128 128; \
min: 16 16; \
parts { \
part { \
name: "icon"; \
type: IMAGE; \
mouse_events: 0; \
description { \
state: "default" 0.0; \
aspect: 1.0 1.0; \
aspect_preference: BOTH; \
image.image: file_ COMP; \
image.normal: file_; \
} \
} \
} \
}
ICO("connman-tech-connected", "connman-tech-connected.png");
ICO("connman-tech-powered", "connman-tech-powered.png");
ICO("connman-tech-offline", "connman-tech-offline.png");
ICO("connman-connected", "connman-connected.png");
ICO("connman-security", "connman-lock.png");
ICO("connman-security-favorite", "connman-favorite.png");
// quite close to e17 icon
// ICONS: receive the following signals, all with source being "elm"
@ -68,25 +38,9 @@ collections {
// and also the following message:
// id=1, type=MSG_INT, description=strength (0-100)
group {
name: "elm/icon/ethernet/default";
max: 128 128;
min: 16 16;
parts {
part {
name: "icon";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
aspect_preference: BOTH;
image.image: "connman-ethernet.png" COMP;
image.normal: "connman-ethernet.png";
}
}
}
}
ICO("cellular", "connman-cellular.png");
ICO("bluetooth", "connman-bluetooth.png");
ICO("ethernet", "connman-ethernet.png");
group {
name: "elm/icon/wifi/default";
@ -98,7 +52,6 @@ collections {
image: "connman-wifi-bad.png" COMP;
image: "connman-lock.png" COMP;
image: "connman-favorite.png" COMP;
image: "connman-connected.png" COMP;
}
script {
public message(Msg_Type:type, id, ...) {
@ -137,100 +90,7 @@ collections {
}
}
part {
name: "security";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
aspect_preference: BOTH;
image.normal: "connman-lock.png";
visible: 0;
}
description {
state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part {
name: "favorite";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
aspect_preference: BOTH;
image.normal: "connman-favorite.png";
visible: 0;
}
description {
state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part {
name: "connected";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
aspect_preference: BOTH;
image.normal: "connman-connected.png";
visible: 0;
}
description {
state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
programs {
program {
signal: "elm,security,yes";
source: "elm";
action: STATE_SET "visible" 0.0;
target: "security";
}
program {
signal: "elm,security,none";
source: "elm";
action: STATE_SET "default" 0.0;
target: "security";
}
program {
signal: "elm,favorite,yes";
source: "elm";
action: STATE_SET "visible" 0.0;
target: "favorite";
}
program {
signal: "elm,favorite,none";
source: "elm";
action: STATE_SET "default" 0.0;
target: "favorite";
}
program {
signal: "elm,connected,yes";
source: "elm";
action: STATE_SET "visible" 0.0;
target: "connected";
}
program {
signal: "elm,connected,none";
source: "elm";
action: STATE_SET "default" 0.0;
target: "connected";
}
program {
name: "strength,good";
action: STATE_SET "default" 0.0;

View File

@ -623,17 +623,6 @@ class ServicesList(object):
return t.get("Name", item_data[len("/net/connman/service/"):])
def _item_content_get(self, obj, part, item_data):
if part == "elm.swallow.end":
ic = elm.Icon(obj)
ic.standard = "arrow_right"
bt = elm.Button(obj)
bt.content = ic
bt.callback_clicked_add(self._item_disclosure, item_data)
bt.propagate_events = False
return bt
if part != "elm.swallow.icon":
return
s = self.services.get(item_data)
if not s:
return None
@ -645,10 +634,53 @@ class ServicesList(object):
favorite = s.get("Favorite")
roaming = s.get("Roaming")
auto_connect = s.get("AutoConnect")
connected = (str(state) not in ("idle", "failure"))
if part == "elm.swallow.end":
bx = elm.Box(obj)
bx.horizontal = True
bx.homogeneous = True
bx.padding = (2, 0)
bx.align = (1.0, 0.5)
if connected:
ic = elm.Icon(obj)
ic.standard = "connman-connected"
ic.size_hint_min = ic.size_hint_max = (32, 32)
ic.show()
bx.pack_end(ic)
if security and favorite:
ic = elm.Icon(obj)
ic.standard = "connman-security-favorite"
ic.size_hint_min = ic.size_hint_max = (32, 32)
ic.show()
bx.pack_end(ic)
elif security:
ic = elm.Icon(obj)
ic.standard = "connman-security"
ic.size_hint_min = ic.size_hint_max = (32, 32)
ic.show()
bx.pack_end(ic)
ic = elm.Icon(obj)
ic.standard = "arrow_right"
bt = elm.Button(obj)
bt.content = ic
bt.callback_clicked_add(self._item_disclosure, item_data)
bt.propagate_events = False
bt.show()
bt.size_hint_min = bt.size_hint_max = (32, 32)
bx.pack_end(bt)
return bx
if part != "elm.swallow.icon":
return
ly = elm.Layout(obj)
ly.theme_set("icon", type, "default")
ly.size_hint_min_set(48, 48)
ly.size_hint_min_set(32, 32)
def yesno(val):
return ("no", "yes")[bool(val)]
@ -661,8 +693,6 @@ class ServicesList(object):
ly.signal_emit("elm,favorite," + yesno(favorite), "elm")
ly.signal_emit("elm,roaming," + yesno(roaming), "elm")
ly.signal_emit("elm,auto_connect," + yesno(auto_connect), "elm")
connected = (str(state) not in ("idle", "failure"))
ly.signal_emit("elm,connected," + yesno(connected), "elm")
for s in security: