コード例 #1
0
ファイル: gtktoggle.py プロジェクト: d4nj1/TLPUI
def on_button_toggled(self: Gtk.CheckButton, configname: str, tlpconfigbox: Gtk.Box):
    tlpobject = settings.tlpconfig[configname]

    if self.get_active():
        tlpobject.set_enabled(True)
        tlpconfigbox.set_opacity(1)
    else:
        tlpobject.set_enabled(False)
        tlpconfigbox.set_opacity(opacitylevel)
コード例 #2
0
def on_button_toggled(self: Gtk.CheckButton, configname: str,
                      tlpconfigbox: Gtk.Box):
    tlpobject = settings.tlpconfig[configname]

    if self.get_active():
        tlpobject.set_enabled(True)
        tlpconfigbox.set_opacity(1)
    else:
        tlpobject.set_enabled(False)
        tlpconfigbox.set_opacity(opacitylevel)
コード例 #3
0
ファイル: gtktoggle.py プロジェクト: d4nj1/TLPUI
def create_toggle_button(configname:str, tlpconfigbox: Gtk.Box) -> Gtk.CheckButton:
    togglebutton = Gtk.CheckButton()

    if settings.tlpconfig[configname].is_enabled():
        togglebutton.set_active(True)
    else:
        tlpconfigbox.set_opacity(opacitylevel)

    togglebutton.connect('toggled', on_button_toggled, configname, tlpconfigbox)
    return togglebutton
コード例 #4
0
def on_button_toggled(self: Gtk.CheckButton, configname: str, tlpconfigbox: Gtk.Box):
    """Process and store config state."""
    tlpobject = settings.tlpconfig[configname]

    if self.get_active():
        tlpobject.set_enabled(True)
        tlpconfigbox.set_opacity(1)
    else:
        tlpobject.set_enabled(False)
        tlpconfigbox.set_opacity(OPACITY_LEVEL)
コード例 #5
0
def create_toggle_button(configname: str, tlpconfigbox: Gtk.Box) -> Gtk.CheckButton:
    """Create state toggle."""
    togglebutton = Gtk.CheckButton()

    if settings.tlpconfig[configname].is_enabled():
        togglebutton.set_active(True)
    else:
        tlpconfigbox.set_opacity(OPACITY_LEVEL)

    togglebutton.connect('toggled', on_button_toggled, configname, tlpconfigbox)
    return togglebutton