本文整理汇总了Python中efl.elementary.separator.Separator类的典型用法代码示例。如果您正苦于以下问题:Python Separator类的具体用法?Python Separator怎么用?Python Separator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Separator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent):
DialogWindow.__init__(self, parent, 'epack-info', 'Epack', autodel=True)
fr = Frame(self, style='pad_large', size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.resize_object_add(fr)
fr.show()
hbox = Box(self, horizontal=True, padding=(12,12))
fr.content = hbox
hbox.show()
vbox = Box(self, align=(0.0,0.0), padding=(6,6),
size_hint_weight=EXPAND_VERT, size_hint_align=FILL_VERT)
hbox.pack_end(vbox)
vbox.show()
# icon + version
ic = Icon(self, standard='epack', size_hint_min=(64,64))
vbox.pack_end(ic)
ic.show()
lb = Label(self, text=_('Version: %s') % __version__)
vbox.pack_end(lb)
lb.show()
sep = Separator(self, horizontal=True)
vbox.pack_end(sep)
sep.show()
# buttons
bt = Button(self, text=_('Epack'), size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.entry.text_set(utils.INFO))
vbox.pack_end(bt)
bt.show()
bt = Button(self, text=_('Website'),size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: utils.xdg_open(utils.GITHUB))
vbox.pack_end(bt)
bt.show()
bt = Button(self, text=_('Authors'), size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.entry.text_set(utils.AUTHORS))
vbox.pack_end(bt)
bt.show()
bt = Button(self, text=_('License'), size_hint_align=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.entry.text_set(utils.LICENSE))
vbox.pack_end(bt)
bt.show()
# main text
self.entry = Entry(self, editable=False, scrollable=True, text=utils.INFO,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.entry.callback_anchor_clicked_add(lambda e,i: utils.xdg_open(i.name))
hbox.pack_end(self.entry)
self.entry.show()
self.resize(400, 200)
self.show()
示例2: __init__
def __init__(self, parent):
InnerWindow.__init__(self, parent)
vbox = Box(self)
vbox.show()
self.content = vbox
title = Label(self, scale=2.0, text='Edone %s' % VERSION)
title.show()
vbox.pack_end(title)
en = Entry(self, text=INFO, editable=False, scrollable=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
en.show()
vbox.pack_end(en)
sep = Separator(self, horizontal=True)
sep.show()
vbox.pack_end(sep)
close = Button(self, text='Close')
close.callback_clicked_add(lambda b: self.delete())
close.show()
vbox.pack_end(close)
self.activate()
示例3: index_clicked
def index_clicked(obj):
win = StandardWindow("index", "Index test", autodel=True, size=(320, 480))
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
vbox = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(vbox)
vbox.show()
# index
idx = Index(win, size_hint_align=FILL_BOTH, size_hint_weight=EXPAND_BOTH)
idx.callback_delay_changed_add(cb_idx_delay_changed)
idx.callback_changed_add(cb_idx_changed)
idx.callback_selected_add(cb_idx_selected)
win.resize_object_add(idx)
idx.show()
# genlist
itc = GenlistItemClass(item_style="default",
text_get_func=gl_text_get)
# content_get_func=gl_content_get,
# state_get_func=gl_state_get)
gl = Genlist(win, size_hint_align=FILL_BOTH, size_hint_weight=EXPAND_BOTH)
vbox.pack_end(gl)
gl.show()
for i in 'ABCDEFGHILMNOPQRSTUVZ':
for j in 'acegikmo':
gl_item = gl.item_append(itc, i + j)
if j == 'a':
idx_item = idx.item_append(i, cb_idx_item, gl_item)
idx_item.data["gl_item"] = gl_item
idx.level_go(0)
sep = Separator(win, horizontal=True)
vbox.pack_end(sep)
sep.show()
hbox = Box(win, horizontal=True, size_hint_weight=EXPAND_HORIZ)
vbox.pack_end(hbox)
hbox.show()
ck = Check(win, text="autohide_disabled")
ck.callback_changed_add(lambda ck: idx.autohide_disabled_set(ck.state))
hbox.pack_end(ck)
ck.show()
ck = Check(win, text="indicator_disabled")
ck.callback_changed_add(lambda ck: idx.indicator_disabled_set(ck.state))
hbox.pack_end(ck)
ck.show()
ck = Check(win, text="horizontal")
ck.callback_changed_add(lambda ck: idx.horizontal_set(ck.state))
hbox.pack_end(ck)
ck.show()
win.show()
示例4: addTab
def addTab(self, widget, tabName, canClose=True, disabled=False):
self.tabs.append(widget)
btn = Button(self.buttonBox, style="anchor", size_hint_align=ALIGN_LEFT)
btn.text = tabName
btn.data["widget"] = widget
btn.disabled = disabled
btn.callback_clicked_add(self.showTab, widget)
btn.show()
icn = Icon(self.buttonBox)
icn.standard_set("gtk-close")
icn.show()
cls = Button(self.buttonBox, content=icn, style="anchor", size_hint_align=ALIGN_LEFT)
cls.data["widget"] = widget
cls.callback_clicked_add(self.closeTab)
cls.disabled = disabled
if canClose:
cls.show()
sep = Separator(self.buttonBox, size_hint_align=ALIGN_LEFT)
sep.show()
self.buttonBox.pack_end(btn)
self.buttonBox.pack_end(cls)
self.buttonBox.pack_end(sep)
#Arguments go: btn, cls, sep
widget.data["close"] = cls
widget.data["button"] = btn
widget.data["sep"] = sep
self.showTab(widget=widget)
示例5: update_ui
def update_ui(self, listing_in_progress=False):
box = self.header_box
box.clear()
ui_disabled = True
# file listing in progress
if listing_in_progress:
spin = Progressbar(box, style='wheel', pulse_mode=True)
spin.pulse(True)
spin.show()
box.pack_end(spin)
lb = Label(box, text=_('Reading archive, please wait...'),
size_hint_weight=EXPAND_HORIZ,
size_hint_align=(0.0, 0.5))
lb.show()
box.pack_end(lb)
# or header button
else:
if self.app.file_name is None:
txt = _('No archive loaded, click to choose a file')
else:
ui_disabled = False
txt = _('<b>Archive:</b> %s') % \
(os.path.basename(self.app.file_name))
txt = '<align=left>%s</align>' % txt
lb = Label(box, ellipsis=True, text=txt)
bt = Button(box, content=lb, size_hint_weight=EXPAND_HORIZ,
size_hint_fill=FILL_HORIZ)
bt.callback_clicked_add(lambda b: \
FileSelectorInwin(self, _('Choose an archive'),
self._archive_selected_cb,
path=os.getcwd()))
box.pack_end(bt)
bt.show()
# always show the about button
sep = Separator(box)
box.pack_end(sep)
sep.show()
ic = SafeIcon(box, 'help-about', size_hint_min=(24,24))
ic.callback_clicked_add(lambda i: InfoWin(self))
box.pack_end(ic)
ic.show()
for widget in (self.extract_btn, self.fsb,
self.create_folder_chk, self.del_chk):
widget.disabled = ui_disabled
self.update_fsb_label()
示例6: focus5_clicked
def focus5_clicked(obj, item=None):
theme_overlay_add(os.path.join(script_path, "test_focus_custom.edj"))
win = StandardWindow("focus5", "Focus Custom", autodel=True, size=(320, 320))
win.focus_highlight_enabled = True
win.focus_highlight_animate = True
win.focus_highlight_style = "glow"
fr = Frame(win, style="pad_large",
size_hint_weight=EXPAND_BOTH);
win.resize_object_add(fr)
fr.show()
bx = Box(fr)
fr.content = bx
bx.show()
chk = Check(bx, text='Enable glow effect on "Glow" Button', state=True,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bx.pack_end(chk)
chk.show()
spinner = Spinner(bx, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bx.pack_end(spinner)
spinner.show()
bt = Button(bx, text="Glow Button",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bt.callback_focused_add(_glow_effect_on_cb, win, chk)
bt.callback_unfocused_add(_glow_effect_off_cb, win, chk)
bx.pack_end(bt)
bt.show()
sp = Separator(bx, horizontal=True,
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
bx.pack_end(sp)
sp.show()
bx2 = Box(bx, horizontal=True,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx.pack_end(bx2)
bx2.show()
for i in range (1, 5):
bt = Button(bx2, text="Button %d" % i,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx2.pack_end(bt)
bt.show()
win.show()
示例7: theme_clicked
def theme_clicked(obj, data=None):
win = StandardWindow("config", "Theme", autodel=True, size=(400,200))
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
box = Box(win)
box.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
box.show()
win.resize_object_add(box)
bt = Button(win, text = "A button with a custom style")
bt.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
bt.style = "my_custom_style"
bt.show()
box.pack_end(bt)
bt = Button(win, text = "A button with default style")
bt.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
bt.show()
box.pack_end(bt)
sep = Separator(win, horizontal=True)
sep.show()
box.pack_end(sep)
hbox = Box(win, horizontal=True)
hbox.show()
box.pack_end(hbox)
bt = Button(win, text = "Add Extension")
bt.callback_clicked_add(add_ext_clicked_cb)
bt.show()
hbox.pack_end(bt)
bt = Button(win, text = "Remove Extension")
bt.callback_clicked_add(del_ext_clicked_cb)
bt.show()
hbox.pack_end(bt)
bt = Button(win, text = "Add Overlay")
bt.callback_clicked_add(add_ovr_clicked_cb)
bt.show()
hbox.pack_end(bt)
bt = Button(win, text = "Remove Overlay")
bt.callback_clicked_add(del_ovr_clicked_cb)
bt.show()
hbox.pack_end(bt)
win.show()
示例8: header_row_pack
def header_row_pack(self, titles):
"""Takes a list (or a tuple) of tuples (string, bool) and packs them to
the first row of the table."""
assert isinstance(titles, (list, tuple))
for t in titles:
assert isinstance(t, tuple)
assert len(t) == 2
title, sortable = t
try:
assert isinstance(title, basestring)
except:
assert isinstance(title, str)
assert isinstance(sortable, bool)
def sort_btn_cb(button, col):
if self.sort_column == col:
self.reverse()
else:
self.sort_by_column(col)
for count, t in enumerate(titles):
title, sortable = t
btn = Button(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ, text=title)
btn.callback_clicked_add(sort_btn_cb, count)
if not sortable:
btn.disabled = True
btn.show()
self.header_box.pack_end(btn)
self.header_row.append(btn)
elm_list = ScrollableGenlist(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
elm_list.policy_set(ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF)
elm_list.mode_set(ELM_LIST_EXPAND)
#elm_list.go()
elm_list.show()
self.list_box.pack_end(elm_list)
self.lists.append(elm_list)
sep = Separator(self)
sep.show()
self.header_box.pack_end(sep)
self.header_box.pack_end(sep)
示例9: fileselector_entry_clicked
def fileselector_entry_clicked(obj, item=None):
win = StandardWindow("fileselector", "File selector test",
autodel=True, size=(240, 150))
vbox = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(vbox)
vbox.show()
fse = FileselectorEntry(win, text="Select a file", inwin_mode=False,
size_hint_align=FILL_BOTH,
size_hint_weight=EXPAND_BOTH)
vbox.pack_end(fse)
fse.show()
sep = Separator(win, horizontal=True)
vbox.pack_end(sep)
sep.show()
hbox = Box(win, horizontal=True, size_hint_weight=EXPAND_BOTH)
vbox.pack_end(hbox)
hbox.show()
ck = Check(win, text="inwin", state=fse.inwin_mode)
ck.callback_changed_add(toggle_inwin, fse)
hbox.pack_end(ck)
ck.show()
ck = Check(win, text="folder_only", state=fse.folder_only)
ck.callback_changed_add(toggle_folder_only, fse)
hbox.pack_end(ck)
ck.show()
ck = Check(win, text="is_save", state=fse.is_save)
ck.callback_changed_add(toggle_is_save, fse)
hbox.pack_end(ck)
ck.show()
ck = Check(win, text="expandable", state=fse.expandable)
ck.callback_changed_add(toggle_expandable, fse)
hbox.pack_end(ck)
ck.show()
win.show()
示例10: separator_clicked
def separator_clicked(obj):
win = StandardWindow("separators", "Separators", autodel=True)
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
bx0 = Box(win, size_hint_weight=EXPAND_BOTH, horizontal=True)
win.resize_object_add(bx0)
bx0.show()
bx = Box(win, size_hint_weight=EXPAND_BOTH)
bx0.pack_end(bx)
bx.show()
bt = Button(win, text="Left upper corner")
bx.pack_end(bt)
bt.show()
sp = Separator(win, horizontal=True)
bx.pack_end(sp)
sp.show()
bt = Button(win, text="Left lower corner", disabled=True)
bx.pack_end(bt)
bt.show()
sp = Separator(win)
bx0.pack_end(sp)
sp.show()
bx = Box(win, size_hint_weight=EXPAND_BOTH)
bx0.pack_end(bx)
bx.show()
bt = Button(win, text="Right upper corner", disabled=True)
bx.pack_end(bt)
bt.show()
sp = Separator(win, horizontal=True)
bx.pack_end(sp)
sp.show()
bt = Button(win, text="Right lower corner")
bx.pack_end(bt)
bt.show()
win.show()
示例11: __init__
def __init__(self, parent, done_cb, title, text=None, guide=None, not_empty=True):
self.done_cb = done_cb
Popup.__init__(self, parent)
self.part_text_set('title,text', title)
box = Box(self, padding=(0,4))
self.content = box
box.show()
if text:
lb = Label(self, text=text)
box.pack_end(lb)
lb.show()
en = Entry(self, single_line=True, scrollable=True,
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
if guide is not None:
en.part_text_set('guide', guide)
box.pack_end(en)
en.show()
sep = Separator(self, horizontal=True, size_hint_expand=EXPAND_HORIZ)
box.pack_end(sep)
sep.show()
b = Button(self, text='Cancel')
b.callback_clicked_add(lambda b: self.delete())
self.part_content_set('button1', b)
b.show()
b = Button(self, text='OK', disabled=not_empty)
b.callback_clicked_add(self._confirmed_cb, en, done_cb)
self.part_content_set('button2', b)
b.show()
if not_empty is True:
en.callback_changed_user_add(self._entry_changed, b)
en.focus = True
self.show()
示例12: __init__
def __init__(self, parent, session):
self.session = session
conf = session.conf
PreferencesDialog.__init__(self, "General")
limits = Limits(self, session)
ports = ListenPorts(self, session)
pe = EncryptionSettings(self, session)
dlsel = DataStorageSelector(self, conf)
pad = Rectangle(self.evas)
pad.color = 0, 0, 0, 0
pad.size_hint_min = 0, 10
sep1 = Separator(self)
sep1.horizontal = True
chk1 = Check(self)
chk1.size_hint_align = 0.0, 0.0
chk1.text = "Delete original .torrent file when added"
chk1.state = conf.getboolean("Settings", "delete_original")
chk1.callback_changed_add(lambda x: conf.set("Settings",
"delete_original", str(bool(chk1.state))))
chk2 = Check(self)
chk2.size_hint_align = 0.0, 0.0
chk2.text = "Ask for confirmation on exit"
chk2.state = conf.getboolean("Settings", "confirmations")
chk2.callback_changed_add(lambda x: conf.set("Settings",
"confirmations", str(bool(chk2.state))))
sep2 = Separator(self)
sep2.horizontal = True
for w in ports, limits, dlsel, pe, pad, sep1, chk1, chk2, sep2:
w.show()
self.box.pack_end(w)
示例13: __init__
def __init__(self, parent, app, branch):
self.app = app
self.branch = branch
Popup.__init__(self, parent)
self.part_text_set("title,text", "Delete branch")
self.part_content_set("title,icon", Icon(self, standard="user-trash"))
# main vertical box
box = Box(self)
self.content = box
box.show()
# sep
sep = Separator(self, horizontal=True, size_hint_expand=EXPAND_BOTH)
box.pack_end(sep)
sep.show()
# label
en = Entry(
self,
editable=False,
text="%s<br><br><hilight>%s</hilight><br>" % ("Are you sure you want to delete this branch?", branch.name),
size_hint_expand=EXPAND_BOTH,
size_hint_fill=FILL_BOTH,
)
box.pack_end(en)
en.show()
# force checkbox
ck = Check(
self,
text="Force delete (even if not fully merged)",
size_hint_expand=EXPAND_BOTH,
size_hint_align=(0.0, 0.5),
)
box.pack_end(ck)
ck.show()
self.force_chk = ck
# buttons
sep = Separator(self, horizontal=True, size_hint_expand=EXPAND_BOTH)
box.pack_end(sep)
sep.show()
bt = Button(self, text="Cancel")
bt.callback_clicked_add(lambda b: self.delete())
self.part_content_set("button1", bt)
bt.show()
bt = Button(self, text="Delete branch")
bt.callback_clicked_add(self._delete_btn_cb)
self.part_content_set("button2", bt)
bt.show()
#
self.show()
示例14: image_clicked
def image_clicked(obj):
win = StandardWindow("image", "Image test", autodel=True, size=(320, 480))
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
vbox = Box(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
win.resize_object_add(vbox)
vbox.show()
im = Image(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
file=os.path.join(img_path, "logo.png"))
vbox.pack_end(im)
im.show()
sep = Separator(win, horizontal=True)
vbox.pack_end(sep)
sep.show()
hbox = Box(win, layout=ELM_BOX_LAYOUT_FLOW_HORIZONTAL,
size_hint_align=FILL_BOTH)
vbox.pack_end(hbox)
hbox.show()
for rot in orients:
b = Button(win, text=rot[0])
hbox.pack_end(b)
b.callback_clicked_add(lambda b, y=rot[1]: im.orient_set(y))
b.show()
sep = Separator(win, horizontal=True)
vbox.pack_end(sep)
sep.show()
hbox = Box(win, horizontal=True, size_hint_align=FILL_BOTH)
vbox.pack_end(hbox)
hbox.show()
b = Button(win, text="Set remote URL")
hbox.pack_end(b)
b.callback_clicked_add(lambda b: im.file_set(remote_url))
b.show()
pb = Progressbar(win, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
hbox.pack_end(pb)
pb.show()
im.callback_download_start_add(_cb_im_download_start, pb)
im.callback_download_done_add(_cb_im_download_done)
im.callback_download_progress_add(_cb_im_download_progress, pb)
im.callback_download_error_add(_cb_im_download_error, pb)
win.show()
示例15: __init__
def __init__(self, parent, app):
self.app = app
Popup.__init__(self, parent)
self.part_text_set('title,text', 'Save current status')
self.part_content_set('title,icon', SafeIcon(self, 'git-stash'))
# main vertical box
box = Box(self, size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
self.content = box
box.show()
# separator
sep = Separator(self, horizontal=True, size_hint_expand=EXPAND_HORIZ)
box.pack_end(sep)
sep.show()
# description
en = Entry(self, single_line=True, scrollable=True,
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
en.part_text_set('guide', 'Stash description (or empty for the default)')
en.text = 'WIP on ' + app.repo.status.head_describe
box.pack_end(en)
en.show()
# include untracked
ck = Check(self, text='Include untracked files', state=True,
size_hint_expand=EXPAND_HORIZ, size_hint_align=(0.0,0.5))
box.pack_end(ck)
ck.show()
# separator
sep = Separator(self, horizontal=True, size_hint_expand=EXPAND_HORIZ)
box.pack_end(sep)
sep.show()
# buttons
bt = Button(self, text='Close')
bt.callback_clicked_add(lambda b: self.delete())
self.part_content_set('button1', bt)
bt.show()
bt = Button(self, text='Stash', content=SafeIcon(self, 'git-stash'))
bt.callback_clicked_add(self._stash_clicked_cb, en, ck)
self.part_content_set('button2', bt)
bt.show()
# focus to the entry and show
en.select_all()
en.focus = True
self.show()