本文整理汇总了Python中utils.scale_nicely函数的典型用法代码示例。如果您正苦于以下问题:Python scale_nicely函数的具体用法?Python scale_nicely怎么用?Python scale_nicely使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scale_nicely函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _reload_account_list
def _reload_account_list(self, *args):
'''reload the account list in the combobox'''
self.liststore.clear()
for mail in sorted(self.accounts):
self.liststore.append([mail, utils.scale_nicely(self.pixbuf)])
#this resolves a small bug
if not len(self.liststore):
self.liststore = None
开发者ID:DarKprince,项目名称:emesene2,代码行数:9,代码来源:Login.py
示例2: _reload_account_list
def _reload_account_list(self, *args):
'''
reload the account list in the combobox
'''
self.liststore.clear()
mail_list = []
for account in sorted(self.accounts):
mail = account.rpartition('|')[0]
if mail not in mail_list:
mail_list.append(mail)
self.liststore.append([mail, utils.scale_nicely(self.pixbuf)])
#this resolves a small bug
if not len(self.liststore):
self.liststore = None
开发者ID:sreekumar-kr,项目名称:emesene,代码行数:15,代码来源:Login.py
示例3: __init__
def __init__(self, callback, args=None):
gtk.Alignment.__init__(self, xalign=0.5, yalign=0.5, xscale=0.0,
yscale=1.0)
self.dialog = extension.get_default('dialog')
Avatar = extension.get_default('avatar')
NiceBar = extension.get_default('nice bar')
default_session = extension.get_default('session')
self.liststore = gtk.ListStore(gobject.TYPE_STRING, gtk.gdk.Pixbuf)
completion = gtk.EntryCompletion()
completion.set_model(self.liststore)
pixbufcell = gtk.CellRendererPixbuf()
completion.pack_start(pixbufcell)
completion.add_attribute(pixbufcell, 'pixbuf', 1)
completion.set_text_column(0)
completion.set_inline_selection(True)
self.pixbuf = utils.safe_gtk_pixbuf_load(gui.theme.user)
self.cmb_account = gtk.ComboBoxEntry(self.liststore, 0)
self.cmb_account.get_children()[0].set_completion(completion)
self.cmb_account.get_children()[0].connect('key-press-event',
self._on_account_key_press)
self.cmb_account.connect('changed',
self._on_account_changed)
self.cmb_account.connect('key-release-event',
self._on_account_key_release)
self.btn_status = StatusButton.StatusButton()
self.btn_status.set_status(e3.status.ONLINE)
self.txt_password = gtk.Entry()
self.txt_password.set_visibility(False)
self.txt_password.connect('key-press-event',
self._on_password_key_press)
self.txt_password.connect('changed', self._on_password_changed)
self.txt_password.set_sensitive(False)
pix_account = utils.safe_gtk_pixbuf_load(gui.theme.user)
pix_password = utils.safe_gtk_pixbuf_load(gui.theme.password)
self.avatar = Avatar()
self.remember_account = gtk.CheckButton(_('Remember me'))
self.remember_password = gtk.CheckButton(_('Remember password'))
self.auto_login = gtk.CheckButton(_('Auto-login'))
self.remember_account.connect('toggled',
self._on_remember_account_toggled)
self.remember_password.connect('toggled',
self._on_remember_password_toggled)
self.auto_login.connect('toggled',
self._on_auto_login_toggled)
self.remember_account.set_sensitive(False)
self.remember_password.set_sensitive(False)
self.auto_login.set_sensitive(False)
self.forget_me = gtk.Button()
self.forget_me.set_tooltip_text(_('Delete user'))
forget_img = gtk.image_new_from_stock(gtk.STOCK_CANCEL, gtk.ICON_SIZE_MENU)
self.forget_me.set_image(forget_img)
self.forget_me.set_relief(gtk.RELIEF_NONE)
self.forget_me.set_border_width(0)
self.forget_me.connect('clicked', self._on_forget_me_clicked)
self.forget_me.set_sensitive(False)
hboxremember = gtk.HBox(spacing=2)
hboxremember.pack_start(self.remember_account, False, False)
vbox_remember = gtk.VBox(spacing=4)
vbox_remember.set_border_width(8)
vbox_remember.pack_start(hboxremember)
vbox_remember.pack_start(self.remember_password)
vbox_remember.pack_start(self.auto_login)
self.b_connect = gtk.Button(stock=gtk.STOCK_CONNECT)
self.b_connect.connect('clicked', self._on_connect_clicked)
self.b_connect.set_sensitive(False)
self.b_cancel = gtk.Button(stock=gtk.STOCK_CANCEL)
self.b_cancel.connect('clicked', self._on_cancel_clicked)
vbuttonbox = gtk.VButtonBox()
vbuttonbox.set_spacing(8)
vbuttonbox.pack_start(self.b_connect)
vbuttonbox.pack_start(self.b_cancel)
vbox = gtk.VBox()
hbox_account = gtk.HBox(spacing=6)
img_accountpix = gtk.Image()
img_accountpix.set_from_pixbuf(utils.scale_nicely(pix_account))
hbox_account.pack_start(img_accountpix, False)
hbox_account.pack_start(self.cmb_account, True, True)
hbox_account.pack_start(self.forget_me, False)
hbox_password = gtk.HBox(spacing=6)
#.........这里部分代码省略.........
开发者ID:andreskru,项目名称:emesene,代码行数:101,代码来源:Login.py
示例4: __init__
#.........这里部分代码省略.........
self.auto_login = gtk.CheckButton(_('Auto-login'))
self.remember_account.connect('toggled',
self._on_remember_account_toggled)
self.remember_password.connect('toggled',
self._on_remember_password_toggled)
self.auto_login.connect('toggled',
self._on_auto_login_toggled)
self.forget_me = gtk.EventBox()
self.forget_me.set_events(gtk.gdk.BUTTON_PRESS_MASK)
self.forget_me_label = gtk.Label('<span foreground="#0000AA">(' + \
_('Forget me') + ')</span>')
self.forget_me_label.set_use_markup(True)
self.forget_me.add(self.forget_me_label)
self.forget_me.connect('button_press_event', self._on_forget_me_clicked)
self.forget_me.set_child_visible(False)
hboxremember = gtk.HBox(spacing=2)
hboxremember.pack_start(self.remember_account, False, False)
hboxremember.pack_start(self.forget_me, False, False)
vbox_remember = gtk.VBox(spacing=4)
vbox_remember.set_border_width(8)
vbox_remember.pack_start(hboxremember)
vbox_remember.pack_start(self.remember_password)
vbox_remember.pack_start(self.auto_login)
self.b_connect = gtk.Button(stock=gtk.STOCK_CONNECT)
self.b_connect.connect('clicked', self._on_connect_clicked)
self.b_connect.set_border_width(8)
vbox = gtk.VBox()
hbox_account = gtk.HBox(spacing=6)
img_accountpix = gtk.Image()
img_accountpix.set_from_pixbuf(utils.scale_nicely(pix_account))
hbox_account.pack_start(img_accountpix, False)
hbox_account.pack_start(self.cmb_account, True, True)
hbox_account.pack_start(status_padding, False)
hbox_password = gtk.HBox(spacing=6)
img_password = gtk.Image()
img_password.set_from_pixbuf(utils.scale_nicely(pix_password))
hbox_password.pack_start(img_password, False)
hbox_password.pack_start(self.txt_password, True, True)
hbox_password.pack_start(self.btn_status, False)
vbox_entries = gtk.VBox(spacing=12)
vbox_entries.set_border_width(8)
vbox_entries.pack_start(hbox_account)
vbox_entries.pack_start(hbox_password)
self.b_preferences = gtk.Button()
self.img_preferences = gtk.image_new_from_stock(gtk.STOCK_PREFERENCES,
gtk.ICON_SIZE_MENU)
self.img_preferences.set_sensitive(False)
self.b_preferences.set_image(self.img_preferences)
self.b_preferences.set_relief(gtk.RELIEF_NONE)
self.b_preferences.connect('enter-notify-event',
self._on_preferences_enter)
self.b_preferences.connect('leave-notify-event',
self._on_preferences_leave)
self.b_preferences.connect('clicked',
self._on_preferences_selected)
self.nicebar = NiceBar.NiceBar(default_background= \
NiceBar.ALERTBACKGROUND)
al_logo = gtk.Alignment(xalign=0.5, yalign=0.5, xscale=0.0,
yscale=0.0)
al_vbox_entries = gtk.Alignment(xalign=0.5, yalign=0.5, xscale=0.2,
yscale=0.0)
al_vbox_remember = gtk.Alignment(xalign=0.55, yalign=0.5, xscale=0.05,
yscale=0.2)
al_button = gtk.Alignment(xalign=0.5, yalign=0.5, xscale=0.15)
al_account = gtk.Alignment(xalign=0.5, yalign=0.5, xscale=0.0,
yscale=0.0)
al_preferences = gtk.Alignment(xalign=1.0, yalign=0.5)
al_vbox_entries.add(vbox_entries)
al_vbox_remember.add(vbox_remember)
al_button.add(self.b_connect)
al_account.add(self.img_account)
al_preferences.add(self.b_preferences)
vbox.pack_start(self.nicebar, False)
vbox.pack_start(al_account, True, False)
vbox.pack_start(al_vbox_entries, True, True)
vbox.pack_start(al_vbox_remember, True, False)
vbox.pack_start(al_button, True, True)
vbox.pack_start(al_preferences, False)
self.add(vbox)
vbox.show_all()
self.nicebar.hide()
if account != '':
self.cmb_account.get_children()[0].set_text(account)
开发者ID:JPtja,项目名称:emesene,代码行数:101,代码来源:Login.py
示例5: __init__
def __init__(self, callback, args=None):
gtk.Alignment.__init__(self, xalign=0.5, yalign=0.5, xscale=0.0, yscale=1.0)
self.dialog = extension.get_default("dialog")
Avatar = extension.get_default("avatar")
NiceBar = extension.get_default("nice bar")
self.liststore = gtk.ListStore(gobject.TYPE_STRING, gtk.gdk.Pixbuf)
completion = gtk.EntryCompletion()
completion.set_model(self.liststore)
pixbufcell = gtk.CellRendererPixbuf()
completion.pack_start(pixbufcell)
completion.add_attribute(pixbufcell, "pixbuf", 1)
completion.set_text_column(0)
completion.set_inline_selection(True)
self.pixbuf = utils.safe_gtk_pixbuf_load(gui.theme.user)
self.cmb_account = gtk.ComboBoxEntry(self.liststore, 0)
self.cmb_account.set_tooltip_text(_("Account"))
self.cmb_account.get_children()[0].set_completion(completion)
self.cmb_account.get_children()[0].connect("key-press-event", self._on_account_key_press)
self.cmb_account.connect("changed", self._on_account_changed)
self.cmb_account.connect("key-release-event", self._on_account_key_release)
self.btn_status = StatusButton.StatusButton()
self.btn_status.set_tooltip_text(_("Status"))
self.btn_status.set_status(e3.status.ONLINE)
self.btn_status.set_size_request(34, -1)
self.txt_password = gtk.Entry()
self.txt_password.set_tooltip_text(_("Password"))
self.txt_password.set_visibility(False)
self.txt_password.connect("key-press-event", self._on_password_key_press)
self.txt_password.connect("changed", self._on_password_changed)
self.txt_password.set_sensitive(False)
pix_account = utils.safe_gtk_pixbuf_load(gui.theme.user)
pix_password = utils.safe_gtk_pixbuf_load(gui.theme.password)
self.avatar = Avatar()
self.remember_account = gtk.CheckButton(_("Remember me"))
self.remember_password = gtk.CheckButton(_("Remember password"))
self.auto_login = gtk.CheckButton(_("Auto-login"))
self.remember_account.connect("toggled", self._on_remember_account_toggled)
self.remember_password.connect("toggled", self._on_remember_password_toggled)
self.auto_login.connect("toggled", self._on_auto_login_toggled)
self.remember_account.set_sensitive(False)
self.remember_password.set_sensitive(False)
self.auto_login.set_sensitive(False)
self.forget_me = gtk.Button()
self.forget_me.set_tooltip_text(_("Delete user"))
forget_img = gtk.image_new_from_stock(gtk.STOCK_CANCEL, gtk.ICON_SIZE_MENU)
self.forget_me.set_image(forget_img)
self.forget_me.set_relief(gtk.RELIEF_NONE)
self.forget_me.set_border_width(0)
self.forget_me.set_size_request(34, -1)
self.forget_me.connect("clicked", self._on_forget_me_clicked)
self.forget_me.set_sensitive(False)
hboxremember = gtk.HBox(spacing=2)
hboxremember.pack_start(self.remember_account, False)
vbox_remember = gtk.VBox(spacing=4)
vbox_remember.set_border_width(8)
vbox_remember.pack_start(hboxremember)
vbox_remember.pack_start(self.remember_password)
vbox_remember.pack_start(self.auto_login)
vbox_remember.pack_start(gtk.Label())
self.b_connect = gtk.Button(stock=gtk.STOCK_CONNECT)
self.b_connect.set_sensitive(False)
self.b_cancel = gtk.Button(stock=gtk.STOCK_CANCEL)
self.b_cancel.connect("clicked", self._on_cancel_clicked)
vbuttonbox = gtk.VButtonBox()
vbuttonbox.set_spacing(8)
vbuttonbox.pack_start(self.b_connect)
vbuttonbox.pack_start(self.b_cancel)
vbox_content = gtk.VBox()
hbox_account = gtk.HBox(spacing=6)
img_accountpix = gtk.Image()
img_accountpix.set_from_pixbuf(utils.scale_nicely(pix_account))
hbox_account.pack_start(img_accountpix, False)
hbox_account.pack_start(self.cmb_account)
hbox_account.pack_start(self.forget_me, False)
hbox_password = gtk.HBox(spacing=6)
img_password = gtk.Image()
img_password.set_from_pixbuf(utils.scale_nicely(pix_password))
hbox_password.pack_start(img_password, False)
hbox_password.pack_start(self.txt_password)
hbox_password.pack_start(self.btn_status, False)
#.........这里部分代码省略.........
开发者ID:nenemfromhell,项目名称:emesene,代码行数:101,代码来源:Login.py
示例6: __init__
def __init__(self, callback, on_preferences_changed, account,
accounts=None, remember_account=None, remember_password=None,
statuses=None, proxy=None, use_http=False, session_id=None):
gtk.Alignment.__init__(self, xalign=0.5, yalign=0.5, xscale=1.0,
yscale=1.0)
account = account or e3.Account("", "", e3.status.ONLINE)
self.callback = callback
self.on_preferences_changed = on_preferences_changed
self.accounts = accounts or {}
self.l_remember_account = remember_account or []
self.l_remember_password = remember_password or []
self.statuses = statuses or {}
# the id of the default extension that handles the session
# used to select the default session on the preference dialog
self.use_http = use_http
self.session_id = session_id
if proxy is None:
self.proxy = e3.Proxy()
else:
self.proxy = proxy
liststore = gtk.ListStore(gobject.TYPE_STRING, gtk.gdk.Pixbuf)
completion = gtk.EntryCompletion()
completion.set_model(liststore)
pixbufcell = gtk.CellRendererPixbuf()
completion.pack_start(pixbufcell)
completion.add_attribute(pixbufcell, 'pixbuf', 1)
completion.set_text_column(0)
completion.set_inline_selection(True)
pixbuf = utils.safe_gtk_pixbuf_load(gui.theme.user)
for mail in sorted(self.accounts):
liststore.append([mail, utils.scale_nicely(pixbuf)])
self.cmb_account = gtk.ComboBoxEntry(liststore, 0)
self.cmb_account.get_children()[0].set_completion(completion)
self.cmb_account.get_children()[0].connect('key-press-event',
self._on_account_key_press)
self.cmb_account.connect('changed',
self._on_account_changed)
if account:
self.cmb_account.prepend_text(account.account)
self.btn_status = StatusButton.StatusButton()
status_padding = gtk.Label()
status_padding.set_size_request(*self.btn_status.size_request())
self.txt_password = gtk.Entry()
self.txt_password.set_visibility(False)
if account:
self.txt_password.set_text(account.password)
self.txt_password.connect('key-press-event',
self._on_password_key_press)
pix_account = utils.safe_gtk_pixbuf_load(gui.theme.user)
pix_password = utils.safe_gtk_pixbuf_load(gui.theme.password)
img_logo = utils.safe_gtk_image_load(gui.theme.logo)
th_pix = utils.safe_gtk_pixbuf_load(gui.theme.throbber, None, animated=True)
self.throbber = gtk.image_new_from_animation(th_pix)
self.remember_account = gtk.CheckButton(_('Remember account'))
self.remember_password = gtk.CheckButton(_('Remember password'))
self.remember_account.connect('toggled',
self._on_remember_account_toggled)
self.remember_password.connect('toggled',
self._on_remember_password_toggled)
vbox_remember = gtk.VBox(spacing=4)
vbox_remember.set_border_width(8)
vbox_remember.pack_start(self.throbber)
vbox_remember.pack_start(self.remember_account)
vbox_remember.pack_start(self.remember_password)
self.b_connect = gtk.Button(stock=gtk.STOCK_CONNECT)
self.b_connect.connect('clicked', self._on_connect_clicked)
self.b_connect.set_border_width(8)
vbox = gtk.VBox()
vbox.set_border_width(2)
hbox_account = gtk.HBox(spacing=6)
img_account = gtk.Image()
img_account.set_from_pixbuf(utils.scale_nicely(pix_account))
hbox_account.pack_start(img_account, False)
hbox_account.pack_start(self.cmb_account, True, True)
hbox_account.pack_start(status_padding, False)
hbox_password = gtk.HBox(spacing=6)
img_password = gtk.Image()
img_password.set_from_pixbuf(utils.scale_nicely(pix_password))
#.........这里部分代码省略.........
开发者ID:Otacon,项目名称:emesene,代码行数:101,代码来源:Login.py
注:本文中的utils.scale_nicely函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论