Esempio n. 1
0
 def label(win, label):
     lb = Label(win)
     lb.size_hint_weight_set(EVAS_HINT_EXPAND, 0.0)
     if label is None:
         pass
     elif " MB" in label or " GB" in label or "Free" in label or "Used" in label or "Total" in label:
         lb.size_hint_align_set(1.0, EVAS_HINT_FILL)
     else:
         lb.size_hint_align_set(-1.0, EVAS_HINT_FILL)
     lb.text = label
     lb.show()
     return lb
Esempio n. 2
0
    def notify(self, message):
        if self.__notification:
            self.__notification.hide()
            self.__notification.delete()
            self.__notification = None
        self.__notification = Notify(self)
        self.__notification.timeout_set(2)
        self.__notification.orient_set(ELM_NOTIFY_ORIENT_TOP)

        bx = Box(self)
        bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        bx.horizontal_set(True)
        self.__notification.content_set(bx)
        bx.show()

        lb = Label(self)
        lb.text_set(message)
        bx.pack_end(lb)
        lb.show()

        self.__notification.show()
Esempio n. 3
0
    def view(self, parent, **kargs):
        """Create a view of the Item

        :Parameters:
            `parent` : gui.Widget
                The parent widget the view will be created in

        :Returns: the widget that represents the item
        """
        ret = Box(parent, axis=0, border=0)
        Label(ret, "%s:" % self.field.name)
        if self.value:
            self.value.view(ret)
        return ret
Esempio n. 4
0
    def _notify(self, message):
        if self.__notification:
            self.__notification.hide()
            self.__notification.delete()
            self.__notification = None
        self.__notification = Notify(self._parent)
        self.__notification.timeout_set(4)
        self.__notification.orient_set(ELM_NOTIFY_ORIENT_BOTTOM)

        bx = Box(self)
        bx.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
        bx.horizontal_set(True)
        self.__notification.content_set(bx)
        bx.show()

        lb = Label(self)
        lb.text_set(message)
        bx.pack_end(lb)
        lb.show()

        self.__notification.show()
    def _show_actions(self, it, ti, state):
        strstate = "%s %.2f" % state
        self.actions_box = Box(self._pop)
        name_box = Box(self._pop)
        lb_state = Label(self._pop)
        lb_state.text_set("<b>State: ")
        lb_name = Label(self._pop)
        lb_name.text_set(strstate)
        name_box.horizontal_set(True)
        name_box.pack_end(lb_state)
        lb_state.show()
        name_box.pack_end(lb_name)
        lb_name.show()
        self.actions_box.pack_end(name_box)
        name_box.show()
        space = Label(self._pop)
        space.text_set(" ")
        self.actions_box.pack_end(space)
        space.show()
        self._action_button_add("Change to", self._states_select_cb, state)
        self._action_button_add("Reset to", self._reset_state_to_cb, state)
        btn_delete = self._action_button_add(
            "Delete", self._remove_state_cb, state)

        if self._is_default(state):
            btn_delete.disabled_set(True)
            lb_name.style_set("editje.statedefault")
        else:
            lb_name.style_set("editje.statenormal")

        self.pager.content_push(self.actions_box)
        self._pop.actions_clear()
        self._pop.action_add("Back", self._back_to_list_cb)
        self._pop.action_add("Close", self._cancel_clicked)
Esempio n. 6
0
    def _show_actions(self, it, ti, state):
        strstate = "%s %.2f" % state
        self.actions_box = Box(self._pop)
        name_box = Box(self._pop)
        lb_state = Label(self._pop)
        lb_state.text_set("<b>State: ")
        lb_name = Label(self._pop)
        lb_name.text_set(strstate)
        name_box.horizontal_set(True)
        name_box.pack_end(lb_state)
        lb_state.show()
        name_box.pack_end(lb_name)
        lb_name.show()
        self.actions_box.pack_end(name_box)
        name_box.show()
        space = Label(self._pop)
        space.text_set(" ")
        self.actions_box.pack_end(space)
        space.show()
        self._action_button_add("Change to", self._states_select_cb, state)
        self._action_button_add("Reset to", self._reset_state_to_cb, state)
        btn_delete = self._action_button_add("Delete", self._remove_state_cb,
                                             state)

        if self._is_default(state):
            btn_delete.disabled_set(True)
            lb_name.style_set("editje.statedefault")
        else:
            lb_name.style_set("editje.statenormal")

        self.pager.item_simple_push(self.actions_box)
        self._pop.actions_clear()
        self._pop.action_add("Back", self._back_to_list_cb)
        self._pop.action_add("Close", self._cancel_clicked)