diff --git a/Makefile.am b/Makefile.am index 1c025d6..d344685 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/data/theme/connman-bluetooth.png b/data/theme/connman-bluetooth.png new file mode 100644 index 0000000..a72f75b Binary files /dev/null and b/data/theme/connman-bluetooth.png differ diff --git a/data/theme/connman-cellular.png b/data/theme/connman-cellular.png new file mode 100644 index 0000000..7db8ff6 Binary files /dev/null and b/data/theme/connman-cellular.png differ diff --git a/data/theme/connman-connected.png b/data/theme/connman-connected.png index af60ec9..616d56c 100644 Binary files a/data/theme/connman-connected.png and b/data/theme/connman-connected.png differ diff --git a/data/theme/connman-ethernet.png b/data/theme/connman-ethernet.png index f4290a4..6c19bfe 100644 Binary files a/data/theme/connman-ethernet.png and b/data/theme/connman-ethernet.png differ diff --git a/data/theme/connman-favorite.png b/data/theme/connman-favorite.png index 5327ce5..55de033 100644 Binary files a/data/theme/connman-favorite.png and b/data/theme/connman-favorite.png differ diff --git a/data/theme/connman-lock.png b/data/theme/connman-lock.png index 3db64db..ba241b1 100644 Binary files a/data/theme/connman-lock.png and b/data/theme/connman-lock.png differ diff --git a/data/theme/connman-tech-connected.png b/data/theme/connman-tech-connected.png index 2ad17e9..88e8ad9 100644 Binary files a/data/theme/connman-tech-connected.png and b/data/theme/connman-tech-connected.png differ diff --git a/data/theme/connman-tech-offline.png b/data/theme/connman-tech-offline.png index de900d4..900fef9 100644 Binary files a/data/theme/connman-tech-offline.png and b/data/theme/connman-tech-offline.png differ diff --git a/data/theme/connman-tech-powered.png b/data/theme/connman-tech-powered.png index 7a0b2b2..508747b 100644 Binary files a/data/theme/connman-tech-powered.png and b/data/theme/connman-tech-powered.png differ diff --git a/data/theme/connman-wifi-bad.png b/data/theme/connman-wifi-bad.png index e09ab6f..5f76232 100644 Binary files a/data/theme/connman-wifi-bad.png and b/data/theme/connman-wifi-bad.png differ diff --git a/data/theme/connman-wifi-good.png b/data/theme/connman-wifi-good.png index bffa91f..5c8520f 100644 Binary files a/data/theme/connman-wifi-good.png and b/data/theme/connman-wifi-good.png differ diff --git a/data/theme/connman-wifi-medium.png b/data/theme/connman-wifi-medium.png index 189a63f..15c1cb8 100644 Binary files a/data/theme/connman-wifi-medium.png and b/data/theme/connman-wifi-medium.png differ diff --git a/data/theme/default.edc b/data/theme/default.edc index f1d2c95..d63c6fb 100644 --- a/data/theme/default.edc +++ b/data/theme/default.edc @@ -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; diff --git a/econnman-bin.in b/econnman-bin.in index 75fc830..12afa15 100755 --- a/econnman-bin.in +++ b/econnman-bin.in @@ -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: