本文整理汇总了Python中gi.repository.Gtk.Revealer方法的典型用法代码示例。如果您正苦于以下问题:Python Gtk.Revealer方法的具体用法?Python Gtk.Revealer怎么用?Python Gtk.Revealer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.Gtk
的用法示例。
在下文中一共展示了Gtk.Revealer方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_properties_clicked
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Revealer [as 别名]
def on_properties_clicked(self, btn):
index = self.get_selected_row_index()
is_row_selected = (index is not None)
if hasattr(Gtk, "Revealer") and type(self.sidebar) == Gtk.Revealer:
if not self.sidebar_btn.get_active() or not is_row_selected:
self.hide_sidebar()
return
self.update_sidebar()
self.show_sidebar()
else:
if not is_row_selected:
return
self.sidebar = Gtk.Window(title=_("Properties"))
self.sidebar.set_position(Gtk.WindowPosition.CENTER)
self.sidebar.set_transient_for(self)
self.sidebar.set_modal(True)
self.sidebar.set_resizable(False)
self.create_properties(self.sidebar)
self.update_sidebar()
self.sidebar.show_all()
示例2: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Revealer [as 别名]
def __init__(self):
self.hb = Gtk.HeaderBar().new()
self.hb.props.show_close_button = True
self.hb_revealer = Gtk.Revealer(name="titlebar-revealer-pv")
self.hb_revealer.add(self.hb)
self.hb_revealer.props.transition_duration = 750
self.hb_revealer.set_transition_type(
Gtk.RevealerTransitionType.CROSSFADE)
self.hb_revealer.show()
self.hb_revealer.set_reveal_child(True)
self.hb_container = Gtk.Frame(name="titlebar-container")
self.hb_container.set_shadow_type(Gtk.ShadowType.NONE)
self.hb_container.add(self.hb_revealer)
self.hb_container.show()
self.hb.show_all()
示例3: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Revealer [as 别名]
def __init__(self):
View.__init__(self)
self['notification_bar'] = self.notification_bar = Gtk.Revealer()
self.notification_bar.set_transition_type(Gtk.RevealerTransitionType.SLIDE_UP)
self.notification_bar.set_transition_duration(400)
self.info_bar = Gtk.InfoBar()
self.info_bar.set_show_close_button(True)
self.notification_bar.add(self.info_bar)
self._message_label = Gtk.Label(label="test")
content_area = self.info_bar.get_content_area()
content_area.add(self._message_label)
label.ellipsize_labels_recursively(content_area)
示例4: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Revealer [as 别名]
def __init__(self):
Gtk.Revealer.__init__(self)
self._message = None
self._message_label = Gtk.Label()
self.set_reveal_child(False)
self.set_transition_type(Gtk.RevealerTransitionType.SLIDE_DOWN)
self._build_widget()
示例5: get_transition_type
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Revealer [as 别名]
def get_transition_type(self):
return Gtk.Revealer.TransitionType.NONE
示例6: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Revealer [as 别名]
def __init__(self, title=''):
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
self.title = title
self.arrow = Gtk.Arrow.new(Gtk.ArrowType.RIGHT, Gtk.ShadowType.NONE)
self.title_label = Gtk.Label(label=self.title)
# The section button
self.button = Gtk.Button()
self.button.get_style_context().add_class('flat')
self.button.connect('clicked', self.on_button_clicked)
self.num_label = Gtk.Label()
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
box.pack_start(self.arrow, False, False, 0)
box.set_center_widget(self.title_label)
box.pack_end(self.num_label, False, False, 0)
self.button.add(box)
self.revealer = Gtk.Revealer()
self.revealer.get_style_context().add_class('expander')
self.pack_start(self.button, False, False, 0)
self.pack_start(self.revealer, False, False, 0)
示例7: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Revealer [as 别名]
def __init__(self):
Gtk.Revealer.__init__(self)
self.set_halign(Gtk.Align.FILL)
self.set_valign(Gtk.Align.START)
self.style_context = self.get_style_context()
self.time_out_id = None
self.signal_1_id = None
self.signal_2_id = None
# Main Bar
self.bar = Gtk.Box(homogeneous=Gtk.Orientation.HORIZONTAL)
self.add(self.bar)
# Message Icon
self.icon = Gtk.Image()
self.bar.pack_start(self.icon, False, False, 0)
# Message Label
self.label = Gtk.Label(label='Info')
self.label.set_margin_left(5)
self.label.set_line_wrap(True)
self.bar.pack_start(self.label, False, False, 0)
# Close button
self.close_button = Gtk.Button()
close_icon = Gtk.Image.new_from_icon_name('window-close-symbolic',
Gtk.IconSize.MENU)
self.close_button.add(close_icon)
self.close_button.connect('clicked', self.close)
self.bar.pack_end(self.close_button, False, False, 0)
self.button_2 = Gtk.Button(label='No')
self.bar.pack_end(self.button_2, False, False, 0)
self.button_1 = Gtk.Button(label='Yes')
self.bar.pack_end(self.button_1, False, False, 0)
示例8: show_sidebar
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Revealer [as 别名]
def show_sidebar(self):
if type(self.sidebar) == Gtk.Revealer:
self.sidebar.set_reveal_child(True)
self.sidebar_btn.set_active(True)
示例9: hide_sidebar
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Revealer [as 别名]
def hide_sidebar(self):
if type(self.sidebar) == Gtk.Revealer:
self.sidebar.set_reveal_child(False)
self.sidebar_btn.set_active(False)
if type(self.sidebar) == Gtk.Window:
self.sidebar.close()
self.sidebar = None