本文整理汇总了Python中efl.elementary.frame.Frame.content方法的典型用法代码示例。如果您正苦于以下问题:Python Frame.content方法的具体用法?Python Frame.content怎么用?Python Frame.content使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.frame.Frame
的用法示例。
在下文中一共展示了Frame.content方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: select_torrent
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def select_torrent(self):
sel = Fileselector(self.win)
sel.expandable = False
sel.path_set(os.path.expanduser("~"))
sel.size_hint_weight_set(1.0, 1.0)
sel.size_hint_align_set(-1.0, -1.0)
sel.show()
sf = Frame(self.win)
sf.size_hint_weight_set(1.0, 1.0)
sf.size_hint_align_set(-1.0, -1.0)
sf.text = "Select torrent file"
sf.content = sel
sf.show()
magnet = Entry(self.win)
magnet.single_line = True
magnet.scrollable = True
if hasattr(magnet, "cnp_selection_get"):
magnet.cnp_selection_get(ELM_SEL_TYPE_CLIPBOARD, ELM_SEL_FORMAT_TEXT)
else:
import pyperclip
t = pyperclip.paste()
if t is not None and t.startswith("magnet:"):
magnet.entry = t
magnet.show()
mf = Frame(self.win)
mf.size_hint_weight_set(1.0, 0.0)
mf.size_hint_align_set(-1.0, 0.0)
mf.text = "Or enter magnet URI here"
mf.content = magnet
mf.show()
mbtn = Button(self.win)
mbtn.text = "Done"
mbtn.show()
mbox = Box(self.win)
mbox.size_hint_weight_set(1.0, 0.0)
mbox.size_hint_align_set(-1.0, 0.0)
mbox.horizontal = True
mbox.pack_end(mf)
mbox.pack_end(mbtn)
mbox.show()
box = Box(self.win)
box.size_hint_weight = (1.0, 1.0)
box.size_hint_align = (-1.0, -1.0)
box.pack_end(sf)
box.pack_end(mbox)
box.show()
inwin = InnerWindow(self.win)
inwin.content = box
sel.callback_done_add(self.add_torrent_cb)
sel.callback_done_add(lambda x, y: inwin.delete())
mbtn.callback_clicked_add(self.add_magnet_uri_cb, magnet)
mbtn.callback_clicked_add(lambda x: inwin.delete())
inwin.activate()
示例2: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
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()
示例3: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def __init__(self, cmd, exec_cb):
DialogWindow.__init__(self, _app_instance.win, 'egitu-review',
'Git Command Review', autodel=True, size=(300,50))
# main table (inside a padding frame)
fr = Frame(self, style='default', text='Command to execute',
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
self.resize_object_add(fr)
fr.show()
tb = Table(self, padding=(6,6),
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
fr.content = tb
tb.show()
# cmd entry
en = Entry(self, single_line=True, scrollable=True,
text=utf8_to_markup(cmd),
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
tb.pack(en, 0, 0, 2, 1)
en.show()
# buttons
bt = Button(self, text='Close', size_hint_expand=EXPAND_HORIZ, size_hint_fill=FILL_HORIZ)
bt.callback_clicked_add(lambda b: self.delete())
tb.pack(bt, 0, 1, 1, 1)
bt.show()
bt = Button(self, text='Execute', size_hint_expand=EXPAND_HORIZ, size_hint_fill=FILL_HORIZ)
bt.callback_clicked_add(self._exec_clicked_cb, en, exec_cb)
tb.pack(bt, 1, 1, 1, 1)
bt.show()
#
self.show()
示例4: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def __init__(self, rent):
Box.__init__(self, rent)
self.parent = rent
#This appears on the button in the main swmai window
self.name = "Light DM"
#The section in the main window the button is added to
self.section = "System Settings"
#Search terms that this module should appear for
self.searchData = ["lightdm", "autologin", "login", "display"]
#Command line argument to open this module directly
self.launchArg = "--lightdm"
#Should be none by default. This value is used internally by swami
self.button = None
self.icon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
#Use FDO icons -> http://standards.freedesktop.org/icon-naming-spec/latest/ar01s04.html
self.icon.standard_set('video-display')
self.icon.show()
self.mainBox = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.mainBox.show()
self.config = {}
with open(LightDMConf) as f:
for line in f:
#Sections start with [ - such as [SeatDefaults]
if line[0] != "[":
setting, value = line.replace("\n", "").split("=")
e = Entry(self)
e.single_line_set(True)
e.text = value
e.show()
f = Frame(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
f.text = setting
f.content = e
f.show()
self.mainBox.pack_end(f)
self.config[setting] = f
buttonBox = Box(self, size_hint_weight = EXPAND_HORIZ, size_hint_align = FILL_BOTH)
buttonBox.horizontal = True
buttonSave = StandardButton(self, "Save Changes", "ok", self.savePressed)
buttonSave.show()
buttonReturn = StandardButton(self, "Back", "go-previous", self.returnPressed)
buttonReturn.show()
buttonBox.pack_end(buttonSave)
buttonBox.pack_end(buttonReturn)
buttonBox.show()
self.pack_end(self.mainBox)
self.pack_end(buttonBox)
示例5: focus5_clicked
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
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()
示例6: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def __init__(self, parent_widget, titles=None, *args, **kwargs):
Box.__init__(self, parent_widget, *args, **kwargs)
self.outPut = Entry(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.outPut.editable_set(False)
self.outPut.scrollable_set(True)
self.outPut.callback_changed_add(self.changedCb)
self.outPut.show()
frame = Frame(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
frame.text = "Input:"
frame.autocollapse_set(True)
frame.collapse_go(True)
frame.show()
bx = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
bx.horizontal = True
bx.show()
frame.content = bx
self.inPut = Entry(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.inPut.single_line_set(True)
self.inPut.callback_activated_add(self.enterPressed)
self.inPut.show()
enterButton = Button(self)
enterButton.text = "Execute"
enterButton.callback_pressed_add(self.enterPressed)
enterButton.show()
bx.pack_end(self.inPut)
bx.pack_end(enterButton)
self.pack_end(self.outPut)
self.pack_end(frame)
self.cmd_exe = None
self.done_cb = None
示例7: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def __init__(self, parent_widget, *args, **kwargs):
Box.__init__(self, parent_widget, *args, **kwargs)
self.ourList = ourList = List(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.keys = []
ourList.go()
ourList.show()
self.ourItems = []
sframe = Frame(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
sframe.text = "Search"
self.search = search = Entry(self)
search.single_line = True
search.callback_changed_add(self.searchChange)
sframe.content = search
search.show()
sframe.show()
self.pack_end(ourList)
self.pack_end(sframe)
示例8: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def __init__(self, parent, app, stash=None):
self.app = app
self.stash = stash or app.repo.stash[0]
self.idx = parseint(stash.ref) if stash else 0
DialogWindow.__init__(self, app.win, 'egitu-stash', 'stash',
size=(500,500), autodel=True)
# main vertical box (inside a padding frame)
vbox = Box(self, padding=(0, 6), size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
fr = Frame(self, style='pad_medium', size_hint_weight=EXPAND_BOTH)
self.resize_object_add(fr)
fr.content = vbox
fr.show()
vbox.show()
# header horizontal box
hbox = Box(self, horizontal=True,
size_hint_expand=EXPAND_HORIZ, size_hint_fill=FILL_HORIZ)
vbox.pack_end(hbox)
hbox.show()
# title
en = Entry(self, editable=False, scrollable=False,
size_hint_expand=EXPAND_HORIZ, size_hint_align=(-1,0.0))
hbox.pack_end(en)
en.show()
self.title_entry = en
# header separator
sep = Separator(self)
hbox.pack_end(sep)
sep.show()
# navigation table
tb = Table(self, size_hint_align=(0.5,0.0))
hbox.pack_end(tb)
tb.show()
lb = Label(self)
tb.pack(lb, 0, 0, 2, 1)
lb.show()
self.nav_label = lb
ic = SafeIcon(self, 'go-previous')
bt = Button(self, text='Prev', content=ic)
bt.callback_clicked_add(self._prev_clicked_cb)
tb.pack(bt, 0, 1, 1, 1)
bt.show()
self.prev_btn = bt
ic = SafeIcon(self, 'go-next')
bt = Button(self, text='Next', content=ic)
bt.callback_clicked_add(self._next_clicked_cb)
tb.pack(bt, 1, 1, 1, 1)
bt.show()
self.next_btn = bt
# diff entry
self.diff_entry = DiffedEntry(self)
vbox.pack_end(self.diff_entry)
self.diff_entry.show()
# buttons
sep = Separator(self, horizontal=True, size_hint_expand=EXPAND_HORIZ)
vbox.pack_end(sep)
sep.show()
hbox = Box(self, horizontal=True,
size_hint_expand=EXPAND_HORIZ, size_hint_fill=FILL_BOTH)
vbox.pack_end(hbox)
hbox.show()
bt = Button(self, text='Apply')
bt.callback_clicked_add(self._apply_clicked_cb)
hbox.pack_end(bt)
bt.show()
bt = Button(self, text='Pop (apply & delete)')
bt.callback_clicked_add(self._pop_clicked_cb)
hbox.pack_end(bt)
bt.show()
bt = Button(self, text='Branch & Delete',
content=SafeIcon(self, 'git-branch'))
bt.callback_clicked_add(self._branch_clicked_cb)
hbox.pack_end(bt)
bt.show()
bt = Button(self, text='Delete',
content=SafeIcon(self, 'user-trash'))
bt.callback_clicked_add(self._drop_clicked_cb)
hbox.pack_end(bt)
bt.show()
sep = Separator(self, size_hint_expand=EXPAND_HORIZ)
hbox.pack_end(sep)
bt = Button(self, text='Close')
#.........这里部分代码省略.........
示例9: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def __init__(self,
command=None, win=None,
start_callback=None, end_callback=None,
*args, **kwargs):
if not win:
nowindow = True
win = self.win = Window("esudo", ELM_WIN_DIALOG_BASIC)
win.title = "eSudo"
win.borderless = True
win.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
win.size_hint_align = evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL
win.resize(300, 200)
win.callback_delete_request_add(lambda o: elementary.exit())
win.layer_set(11)
#~ win.fullscreen = True
win.show()
win.activate()
bg = Background(win)
bg.size_hint_weight = 1.0, 1.0
win.resize_object_add(bg)
bg.show()
self.embedded = False
else:
nowindow = False
self.embedded = True
self.cmd = command
self.start_cb = start_callback if callable(start_callback) else None
self.end_cb = end_callback if callable(end_callback) else None
self.args = args
self.kwargs = kwargs
#--------eSudo Window
bz = Box(win)
if nowindow:
bz.size_hint_weight = evas.EVAS_HINT_EXPAND, 0.0
else:
bz.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
bz.size_hint_align = evas.EVAS_HINT_FILL, 0.0
bz.show()
if nowindow:
lbl = Label(win)
lbl.style = "marker"
lbl.color = 170, 170, 170, 255
lbl.size_hint_align = 0.5, 0.0
lbl.scale = 2.0
lbl.text = "<b>eSudo</b>"
bz.pack_end(lbl)
lbl.show()
sep = Separator(win)
sep.horizontal = True
bz.pack_end(sep)
sep.show()
fr = Frame(win)
fr.text = "Command:"
fr.size_hint_align = evas.EVAS_HINT_FILL, 0.0
bz.pack_end(fr)
fr.show()
if nowindow:
sep = Separator(win)
sep.horizontal = True
bz.pack_end(sep)
sep.show()
self.cmdline = cmdline = Entry(win)
cmdline.elm_event_callback_add(self.entry_event)
cmdline.single_line = True
if self.cmd:
cmdline.text = self.cmd
cmdline.editable = False
fr.content = cmdline
cmdline.scrollable_set(True)
cmdline.show()
if nowindow:
fr = Frame(win)
fr.text = "Password:"
fr.size_hint_align = evas.EVAS_HINT_FILL, 0.0
bz.pack_end(fr)
fr.show()
else:
bz1 = Box(win)
bz.pack_end(bz1)
bz1.show()
lb = Label(win)
lb.text = "<b>Password:</b>"
lb.size_hint_align = 0.0, 0.5
bz1.pack_end(lb)
lb.show()
en = self.en = Entry(win)
en.name = "password"
en.elm_event_callback_add(self.entry_event)
#.........这里部分代码省略.........
示例10: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def __init__(self, parent, app):
self.app = app
DialogWindow.__init__(self, parent, 'Egitu-tags', 'Tags',
size=(350,350), autodel=True)
# main vertical box (inside a padding frame)
vbox = Box(self, padding=(0, 6), size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
fr = Frame(self, style='pad_medium', size_hint_weight=EXPAND_BOTH)
self.resize_object_add(fr)
fr.content = vbox
fr.show()
vbox.show()
# title
en = Entry(self, editable=False, single_line=True,
text='<title>%s</title>' % 'Tags',
size_hint_expand=EXPAND_HORIZ)
vbox.pack_end(en)
en.show()
# tag list
self.itc = GenlistItemClass(item_style='one_icon',
text_get_func=self._gl_text_get,
content_get_func=self._gl_content_get)
li = Genlist(self, homogeneous=True,
size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
li.callback_selected_add(self._list_selected_cb)
vbox.pack_end(li)
li.show()
self.tags_list = li
# buttons
hbox = Box(self, horizontal=True,
size_hint_expand=EXPAND_HORIZ, size_hint_fill=FILL_BOTH)
vbox.pack_end(hbox)
hbox.show()
bt = Button(self, text='Create', content=Icon(self, standard='git-tag'))
bt.callback_clicked_add(lambda b: CreateTagPopup(self, self.app))
hbox.pack_end(bt)
bt.show()
bt = Button(self, text='Delete', content=Icon(self, standard='user-trash'))
bt.callback_clicked_add(self._delete_clicked_cb)
hbox.pack_end(bt)
bt.show()
self.delete_btn = bt
bt = Button(self, text='Checkout')
bt.callback_clicked_add(self._checkout_clicked_cb)
hbox.pack_end(bt)
bt.show()
self.checkout_btn = bt
sep = Separator(self, size_hint_expand=EXPAND_HORIZ)
hbox.pack_end(sep)
bt = Button(self, text='Close')
bt.callback_clicked_add(lambda b: self.delete())
hbox.pack_end(bt)
bt.show()
#
self.populate()
self.show()
示例11: focus_clicked
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def focus_clicked(obj, item=None):
win = StandardWindow("focus", "Focus", autodel=True, size=(800,600))
win.focus_highlight_enabled = True
tbx = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(tbx)
tbx.show()
### Toolbar
tbar = Toolbar(win, shrink_mode=ELM_TOOLBAR_SHRINK_MENU,
size_hint_align=(EVAS_HINT_FILL,0.0))
tb_it = tbar.item_append("document-print", "Hello", _tb_sel)
tb_it.disabled = True
tb_it = tbar.item_append("folder-new", "World", _tb_sel)
tb_it = tbar.item_append("object-rotate-right", "H", _tb_sel)
tb_it = tbar.item_append("mail-send", "Comes", _tb_sel)
tb_it = tbar.item_append("clock", "Elementary", _tb_sel)
tb_it = tbar.item_append("refresh", "Menu", _tb_sel)
tb_it.menu = True
tbar.menu_parent = win
menu = tb_it.menu
menu.item_add(None, "Shrink", "edit-cut", _tb_sel)
menu_it = menu.item_add(None, "Mode", "edit-copy", _tb_sel)
menu.item_add(menu_it, "is set to", "edit-paste", _tb_sel)
menu.item_add(menu_it, "or to", "edit-paste", _tb_sel)
menu.item_add(None, "Menu", "edit-delete", _tb_sel)
tbx.pack_end(tbar)
tbar.show()
mainbx = Box(win, horizontal=True, size_hint_weight=EXPAND_BOTH)
tbx.pack_end(mainbx)
mainbx.show()
## First Col
bx = Box(win, size_hint_weight=EXPAND_BOTH)
mainbx.pack_end(bx)
bx.show()
lb = Label(win, text="<b>Use Tab or Shift+Tab<br/>or Arrow keys</b>",
size_hint_align=FILL_BOTH)
bx.pack_end(lb)
lb.show()
tg = Check(win, style="toggle")
tg.part_text_set("on", "Yes")
tg.part_text_set("off", "No")
bx.pack_end(tg)
tg.show()
en = Entry(win, scrollable=True, single_line=True, text="This is a single line",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ)
bx.pack_end(en)
en.show()
#
bx2 = Box(win, horizontal=True, size_hint_align=FILL_BOTH)
bx.pack_end(bx2)
bx2.show()
for i in range(2):
bt = Button(win, text="Box", size_hint_align=FILL_BOTH, disabled=(i % 2))
bx2.pack_end(bt)
bt.show()
sc = Scroller(win, bounce=(True,True), content_min_limit=(1,1),
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
bx2.pack_end(sc)
sc.show()
bt = Button(win, text="Scroller", size_hint_align=FILL_BOTH)
sc.content = bt
bt.show()
#
bt = Button(win, text="Box", size_hint_align=FILL_BOTH)
bx.pack_end(bt)
bt.show()
#
bx2 = Box(win, horizontal=True, size_hint_align=FILL_BOTH)
bx.pack_end(bx2)
bx2.show()
for i in range(2):
bx3 = Box(win, size_hint_align=FILL_BOTH)
bx2.pack_end(bx3)
bx3.show()
for j in range(3):
bt = Button(win, text="Box", size_hint_align=FILL_BOTH)
bx3.pack_end(bt)
bt.show()
#.........这里部分代码省略.........
示例12: populate
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def populate(self):
# main vertical box
box = Box(self, size_hint_weight = EXPAND_BOTH)
self.resize_object_add(box)
box.show()
### header
fr = Frame(self, style='outdent_bottom', size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH)
box.pack_end(fr)
fr.show()
tb = Table(self, padding=(3,3),
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
fr.content = tb
tb.show()
# main menu button
bt = MainMenuButton(self.app)
tb.pack(bt, 0, 0, 1, 1)
bt.show()
# editable description entry
self.caption_label = EditableDescription(self.app)
tb.pack(self.caption_label, 1, 0, 1, 1)
self.caption_label.show()
# status label + button
lb = Entry(self, editable=False, line_wrap=ELM_WRAP_NONE)
lb.text_style_user_push("DEFAULT='align=center'")
tb.pack(lb, 2, 0, 1, 1)
lb.show()
self.status_label = lb
# branch selector
self.branch_selector = Hoversel(self, text='HEAD', disabled=True,
content=SafeIcon(self, 'git-branch'))
self.branch_selector.callback_selected_add(self.branch_selected_cb)
tb.pack(self.branch_selector, 3, 0, 1, 1)
self.branch_selector.show()
# pull button
bt = Button(self, text='Pull', disabled=True,
content=SafeIcon(self, 'git-pull'))
bt.callback_clicked_add(self.app.action_pull)
tb.pack(bt, 4, 0, 1, 1)
bt.show()
self.pull_btn = bt
# push button
bt = Button(self, text='Push', disabled=True,
content=SafeIcon(self, 'git-push'))
bt.callback_clicked_add(self.app.action_push)
tb.pack(bt, 5, 0, 1, 1)
bt.show()
self.push_btn = bt
### Tree panes
panes1 = Panes(self, content_left_min_size=200, content_left_size=0.0,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
box.pack_end(panes1)
panes1.show()
# the sidebar on the left
self.sidebar = Sidebar(self, self.app)
panes1.part_content_set('left', self.sidebar)
### Main content (left + right panes)
panes2 = Panes(self, content_left_size=0.5,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
panes1.part_content_set('right', panes2)
panes2.show()
# the dag graph in the center
self.graph = DagGraph(self, self.app)
panes2.part_content_set('left', self.graph)
# the diff viewer on the right
self.diff_view = DiffViewer(self, self.app)
self.diff_view.size_hint_weight = EXPAND_BOTH
self.diff_view.size_hint_align = 0.0, 0.0
panes2.part_content_set('right', self.diff_view)
#
self.show()
示例13: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def __init__(self, rent):
Box.__init__(self, rent)
self.parent = rent
self.name = "Date and Time"
self.section = "System Settings"
self.searchData = ["clock", "timezone", "date", "system"]
self.launchArg = "--time"
self.button = None
self.timezones = getTimeZones()
self.icon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
#Use FDO icons -> http://standards.freedesktop.org/icon-naming-spec/latest/ar01s04.html
self.icon.standard_set('clock')
self.icon.show()
cframe = Frame(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
cframe.text = "Current Time"
cframe.show()
self.clock = clock = Clock(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
clock.show_seconds_set(True)
clock.show_am_pm_set(True)
clock.show()
cframe.content = clock
dframe = Frame(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
dframe.text = "Current Day"
dframe.show()
self.cal = cal = Calendar(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
cal.select_mode = ELM_CALENDAR_SELECT_MODE_NONE
cal.show()
dframe.content = cal
tzframe = Frame(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
tzframe.text = "Current Timezone"
tzframe.show()
self.tz = tz = Label(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
tz.text = "<b>%s</b>"%time.tzname[0]
tz.show()
tzframe.content = tz
self.mainBox = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
self.mainBox.pack_end(cframe)
self.mainBox.pack_end(dframe)
self.mainBox.pack_end(tzframe)
self.mainBox.show()
self.zoneList = zoneList = SearchableList(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
zoneList.callback_item_focused_add(self.enableTZSelect)
self.zones = []
for tz in self.timezones:
for each in self.timezones[tz]:
if each not in self.zones:
self.zones.append(each)
self.zones.sort(reverse=True)
for zone in self.zones:
zoneList.item_append(zone)
zoneList.show()
self.buttonTZSelect = buttonTZSelect = StandardButton(self, "Select", "ok", self.tzselectPressed)
buttonTZSelect.disabled = True
buttonTZSelect.show()
buttonTZCancel = StandardButton(self, "Cancel", "close", self.tzcancelPressed)
buttonTZCancel.show()
tzBBox = Box(self, size_hint_weight = EXPAND_HORIZ, size_hint_align = FILL_BOTH)
tzBBox.horizontal = True
tzBBox.pack_end(buttonTZSelect)
tzBBox.pack_end(buttonTZCancel)
tzBBox.show()
tzChangeBox = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
tzChangeBox.pack_end(zoneList)
tzChangeBox.pack_end(tzBBox)
tzChangeBox.show()
self.flip = Flip(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
self.flip.part_content_set("front", self.mainBox)
self.flip.part_content_set("back", tzChangeBox)
self.flip.show()
buttonBox = Box(self, size_hint_weight = EXPAND_HORIZ, size_hint_align = FILL_BOTH)
buttonBox.horizontal = True
self.buttonApply = buttonApply = StandardButton(self, "Apply Changes", "ok", self.applyPressed)
buttonApply.disabled = True
buttonApply.show()
self.buttonSync = buttonSync = StandardButton(self, "Sync from Internet", "refresh", self.syncPressed)
buttonSync.show()
#.........这里部分代码省略.........
示例14: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def __init__(self):
self.repo = None
self.branch_selector = None
self.caption_label = None
self.status_label = None
self.graph = None
self.diff_view = None
StandardWindow.__init__(self, "egitu", "Efl GIT gUi - Egitu")
self.autodel_set(True)
self.callback_delete_request_add(lambda o: elm.exit())
# main vertical box
box = Box(self, size_hint_weight = EXPAND_BOTH)
self.resize_object_add(box)
box.show()
# header
fr = Frame(self, style="outdent_bottom", size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH)
box.pack_end(fr)
fr.show()
tb = Table(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_BOTH)
fr.content = tb
tb.show()
# main menu button
bt = Button(self, text='Menu')
bt.content = Icon(self, standard='home')
bt.callback_clicked_add(lambda b: EgituMenu(self, b))
tb.pack(bt, 0, 0, 1, 1)
bt.show()
# editable description entry
self.caption_label = EditableDescription(self)
tb.pack(self.caption_label, 1, 0, 1, 1)
self.caption_label.show()
# branch selector
lb = Label(self, text='On branch')
tb.pack(lb, 2, 0, 1, 1)
lb.show()
self.branch_selector = Hoversel(self, text='none')
self.branch_selector.callback_selected_add(self.branch_selected_cb)
tb.pack(self.branch_selector, 3, 0, 1, 1)
self.branch_selector.show()
# status label + button
self.status_label = lb = Entry(self, single_line=True, editable=False)
tb.pack(lb, 4, 0, 1, 1)
lb.show()
### Main content (left + right panes)
panes = Panes(self, content_left_size = 0.5,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
box.pack_end(panes)
panes.show()
# the dag graph inside a scroller on the left
self.graph = DagGraph(self, self.repo)
fr = Frame(self, style="pad_medium", content=self.graph)
scr = Scroller(self, content=fr,
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
scr.bounce_set(0, 1)
panes.part_content_set("left", scr)
# the diff viewer on the right
self.diff_view = DiffViewer(self, self.repo)
self.diff_view.size_hint_weight = EXPAND_BOTH
self.diff_view.size_hint_align = 0.0, 0.0
panes.part_content_set("right", self.diff_view)
self.resize(800, 600)
self.show()
示例15: __init__
# 需要导入模块: from efl.elementary.frame import Frame [as 别名]
# 或者: from efl.elementary.frame.Frame import content [as 别名]
def __init__(self, app):
self.app = app
self.selected_branch = None
DialogWindow.__init__(self, app.win, 'Egitu-branches', 'Branches',
size=(500,500), autodel=True)
# main vertical box (inside a padding frame)
vbox = Box(self, padding=(0, 6), size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
fr = Frame(self, style='pad_medium', size_hint_weight=EXPAND_BOTH)
self.resize_object_add(fr)
fr.content = vbox
fr.show()
vbox.show()
# title
en = Entry(self, editable=False, single_line=True,
text='<title>%s</title>' % 'Local branches',
size_hint_expand=EXPAND_HORIZ)
vbox.pack_end(en)
en.show()
# list
li = List(self, size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
li.callback_selected_add(self._list_selected_cb)
vbox.pack_end(li)
li.show()
self.branches_list = li
# buttons
hbox = Box(self, horizontal=True,
size_hint_expand=EXPAND_HORIZ, size_hint_fill=FILL_BOTH)
vbox.pack_end(hbox)
hbox.show()
ic = SafeIcon(self, 'git-branch')
bt = Button(self, text='Create', content=ic)
bt.callback_clicked_add(lambda b: CreateBranchPopup(self, app))
hbox.pack_end(bt)
bt.show()
ic = SafeIcon(self, 'user-trash')
bt = Button(self, text='Delete', content=ic)
bt.callback_clicked_add(lambda b: DeleteBranchPopup(self, self.app,
self.selected_branch))
hbox.pack_end(bt)
bt.show()
self.delete_btn = bt
ic = SafeIcon(self, 'git-merge')
bt = Button(self, text='Merge', content=ic)
bt.callback_clicked_add(lambda b: MergeBranchPopup(self, app,
self.selected_branch.name))
hbox.pack_end(bt)
bt.show()
self.merge_btn = bt
ic = SafeIcon(self, 'git-compare')
bt = Button(self, text='Compare & Merge', content=ic)
bt.callback_clicked_add(lambda b: \
self.app.action_compare(target=self.selected_branch.name))
hbox.pack_end(bt)
bt.show()
self.merge_btn2 = bt
sep = Separator(self, size_hint_expand=EXPAND_HORIZ)
hbox.pack_end(sep)
bt = Button(self, text='Close')
bt.callback_clicked_add(lambda b: self.delete())
hbox.pack_end(bt)
bt.show()
# populate the list and show the dialog
self.populate()
self.show()