def button(self, tab_child): if FC().tab_close_element == "button": return tab_close_button(func=self.on_delete_tab, arg=tab_child) elif FC().tab_close_element == "label": return notetab_label(func=self.on_delete_tab, arg=tab_child, angle=90)
def __init__(self, controls): gtk.HBox.__init__(self, False, 0) FControl.__init__(self, controls) self.entry = gtk.Entry() self.entry.connect("key-release-event", self.on_key_press) self.search_func = self.controls.filter_by_file file_search = ToggleImageButton(gtk.STOCK_FILE, func=self.set_search_by, param=self.controls.filter_by_file) file_search.set_tooltip_text(_("File search")) file_search.set_active(True) folder_search = ToggleImageButton(gtk.STOCK_DIRECTORY, func=self.set_search_by, param=self.controls.filter_by_folder) folder_search.set_tooltip_text(_("Folder search")) self.list = [file_search, folder_search] OneActiveToggledButton(self.list) """search button""" search = tab_close_button(func=self.on_filter, stock=gtk.STOCK_FIND) self.pack_start(file_search, False, False) self.pack_start(folder_search, False, False) self.pack_start(self.entry, True, True) self.pack_start(search, False, False)
def __init__(self, filterabe): Gtk.Box.__init__(self, orientation=Gtk.Orientation.HORIZONTAL, spacing=0) LoadSave.__init__(self) assert isinstance(filterabe, Filterable) self.entry = Gtk.Entry() self.entry.connect("key-release-event", self.on_key_press) self.search_func = filterabe.filter_by_file file_search = ToggleImageButton("document-new", func=self.set_search_by, param=filterabe.filter_by_file) file_search.set_tooltip_text(_("File search")) file_search.set_active(True) folder_search = ToggleImageButton("folder", func=self.set_search_by, param=filterabe.filter_by_folder) folder_search.set_tooltip_text(_("Folder search")) self.list = [file_search, folder_search] OneActiveToggledButton(self.list) """search button""" search = tab_close_button(func=self.on_filter, stock="edit-find") self.pack_start(file_search, False, False, 0) self.pack_start(folder_search, False, False, 0) self.pack_start(self.entry, True, True, 0) self.pack_start(search, False, False, 0)
def __init__(self, filterabe): Gtk.HBox.__init__(self, False, 0) LoadSave.__init__(self) assert isinstance(filterabe, Filterable) self.entry = Gtk.Entry() self.entry.connect("key-release-event", self.on_key_press) self.search_func = filterabe.filter_by_file file_search = ToggleImageButton(Gtk.STOCK_FILE, func=self.set_search_by, param=filterabe.filter_by_file) file_search.set_tooltip_text(_("File search")) file_search.set_active(True) folder_search = ToggleImageButton(Gtk.STOCK_DIRECTORY, func=self.set_search_by, param=filterabe.filter_by_folder) folder_search.set_tooltip_text(_("Folder search")) self.list = [file_search, folder_search] OneActiveToggledButton(self.list) """search button""" search = tab_close_button(func=self.on_filter, stock=Gtk.STOCK_FIND) self.pack_start(file_search, False, False, 0) self.pack_start(folder_search, False, False, 0) self.pack_start(self.entry, True, True, 0) self.pack_start(search, False, False, 0)
def __init__(self, controls): self.controls = controls box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0) box.hide() """count""" cbox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0) cbox.show() tab_label = Gtk.Label.new(_("Count of tabs:")) tab_label.set_size_request(150, -1) tab_label.set_alignment(0, .5) adjustment = Gtk.Adjustment(value=1, lower=1, upper=20, step_incr=1, page_incr=10, page_size=0) self.tabs_count = Gtk.SpinButton.new(adjustment, 0.0, 0) cbox.pack_start(tab_label, False, False, 0) cbox.pack_start(self.tabs_count, False, True, 0) """len""" lbox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0) lbox.show() tab_label = Gtk.Label.new(_("Max length of tab:")) tab_label.set_size_request(150, -1) tab_label.set_alignment(0, .5) adjustment = Gtk.Adjustment(value=0, lower=-1, upper=300, step_incr=1, page_incr=10, page_size=0) self.tab_len = Gtk.SpinButton(adjustment=adjustment) lbox.pack_start(tab_label, False, False, 0) lbox.pack_start(self.tab_len, False, True, 0) """position""" pbox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 10) label = Gtk.Label.new(_("Tab position:")) label.set_size_request(150, -1) label.set_alignment(0, .5) self.radio_tab_left = Gtk.RadioButton.new_with_label(None, _("Left")) self.radio_tab_left.set_size_request(55, -1) self.radio_tab_top = Gtk.RadioButton.new_with_label_from_widget(self.radio_tab_left, _("Top")) self.radio_tab_top.set_size_request(55, -1) self.radio_tab_no = Gtk.RadioButton.new_with_label_from_widget(self.radio_tab_left, _("No Tabs")) self.radio_tab_no.set_size_request(55, -1) pbox.pack_start(label, False, False, 0) pbox.pack_start(self.radio_tab_left, False, False, 0) pbox.pack_start(self.radio_tab_top, False, False, 0) pbox.pack_start(self.radio_tab_no, False, False, 0) """closed type """ close_label_box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 10) close_label = Gtk.Label.new(_("Close tab sign:")) close_label.set_size_request(150, -1) close_label.set_alignment(0, .5) self.radio_tab_label = Gtk.RadioButton.new_with_label(None, "x") self.radio_tab_label.set_size_request(55, -1) self.radio_tab_button = Gtk.RadioButton.new_from_widget(self.radio_tab_label) self.tab_close_box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0) self.tab_close_box.pack_start(self.radio_tab_button, False, True, 0) self.tab_close_box.pack_start(tab_close_button(), False, False, 0) self.tab_close_box.set_size_request(55, -1) self.radio_tab_none = Gtk.RadioButton.new_with_label_from_widget(self.radio_tab_label, _("None")) self.radio_tab_none.set_size_request(55, -1) close_label_box.pack_start(close_label, False, False, 0) close_label_box.pack_start(self.radio_tab_label, False, False, 0) close_label_box.pack_start(self.tab_close_box, False, False, 0) close_label_box.pack_start(self.radio_tab_none, False, False, 0) """global pack""" box.pack_start(cbox, False, True, 2) box.pack_start(lbox, False, True, 2) box.pack_start(pbox, False, True, 2) box.pack_start(close_label_box, False, True, 2) box.show_all() self.widget = box
def __init__(self, controls): self.controls = controls box = gtk.VBox(False, 0) box.hide() """count""" cbox = gtk.HBox(False, 0) cbox.show() tab_label = gtk.Label(_("Count of tabs")) tab_label.set_size_request(150, -1) tab_label.show() adjustment = gtk.Adjustment(value=1, lower=1, upper=20, step_incr=1, page_incr=10, page_size=0) self.tabs_count = gtk.SpinButton(adjustment) self.tabs_count.connect("value-changed", self.on_chage_count_tabs) self.tabs_count.show() cbox.pack_start(tab_label, False, False, 0) cbox.pack_start(self.tabs_count, False, True, 0) """len""" lbox = gtk.HBox(False, 0) lbox.show() tab_label = gtk.Label(_("Max length of tab")) tab_label.set_size_request(150, -1) tab_label.show() adjustment = gtk.Adjustment(value=0, lower= -1, upper=300, step_incr=1, page_incr=10, page_size=0) self.tab_len = gtk.SpinButton(adjustment) self.tab_len.connect("value-changed", self.on_chage_len_tab) self.tab_len.show() lbox.pack_start(tab_label, False, False, 0) lbox.pack_start(self.tab_len, False, True, 0) """position""" pbox = gtk.HBox(False, 0) pbox.show() label = gtk.Label(_("Tab position")) label.set_size_request(150, -1) label.show() self.radio_tab_left = gtk.RadioButton(None, _("Left")) self.radio_tab_left.connect("toggled", self.on_chage_tab_position) self.radio_tab_left.show() self.radio_tab_top = gtk.RadioButton(self.radio_tab_left, _("Top")) self.radio_tab_top.connect("toggled", self.on_chage_tab_position) self.radio_tab_top.show() self.radio_tab_no = gtk.RadioButton(self.radio_tab_left, _("No Tabs")) self.radio_tab_no.connect("toggled", self.on_chage_tab_position) self.radio_tab_no.show() pbox.pack_start(label, False, False, 0) pbox.pack_start(self.radio_tab_left, False, False, 0) pbox.pack_start(self.radio_tab_top, False, True, 0) pbox.pack_start(self.radio_tab_no, False, True, 0) """closed type """ close_label_box = gtk.HBox(False, 0) close_label_box.show() close_label = gtk.Label(_("Close tab sign")) close_label.show() self.radio_tab_label = gtk.RadioButton(None, None) self.radio_tab_label.connect("toggled", self.on_chage_tab_position) self.radio_tab_label.show() self.radio_tab_button = gtk.RadioButton(self.radio_tab_label, None) self.radio_tab_button.connect("toggled", self.on_chage_tab_position) self.radio_tab_button.show() self.radio_tab_none = gtk.RadioButton(self.radio_tab_label, None) self.radio_tab_none.connect("toggled", self.on_chage_tab_position) self.radio_tab_none.show() close_label_box.pack_start(close_label, False, False, 0) close_label_box.pack_start(self.radio_tab_label, False, False, 0) close_label_box.pack_start(notetab_label(), False, False, 0) close_label_box.pack_start(self.radio_tab_button, False, True, 0) close_label_box.pack_start(tab_close_button(), False, False, 0) close_label_box.pack_start(self.radio_tab_none, False, False, 0) close_label_box.pack_start(gtk.Label(_("None")), False, False, 0) """global pack""" box.pack_start(cbox, False, True, 0) box.pack_start(lbox, False, True, 0) box.pack_start(pbox, False, True, 0) box.pack_start(close_label_box, False, True, 0) self.widget = box
def __init__(self, controls): self.controls = controls box = gtk.VBox(False, 0) box.hide() """count""" cbox = gtk.HBox(False, 0) cbox.show() tab_label = gtk.Label(_("Count of tabs:")) tab_label.set_size_request(150, -1) tab_label.show() adjustment = gtk.Adjustment(value=1, lower=1, upper=20, step_incr=1, page_incr=10, page_size=0) self.tabs_count = gtk.SpinButton(adjustment) self.tabs_count.show() cbox.pack_start(tab_label, False, False, 0) cbox.pack_start(self.tabs_count, False, True, 0) """len""" lbox = gtk.HBox(False, 0) lbox.show() tab_label = gtk.Label(_("Max length of tab:")) tab_label.set_size_request(150, -1) tab_label.show() adjustment = gtk.Adjustment(value=0, lower=-1, upper=300, step_incr=1, page_incr=10, page_size=0) self.tab_len = gtk.SpinButton(adjustment) self.tab_len.show() lbox.pack_start(tab_label, False, False, 0) lbox.pack_start(self.tab_len, False, True, 0) """position""" pbox = gtk.HBox(False, 10) pbox.show() label = gtk.Label(_("Tab position:")) label.set_size_request(150, -1) label.show() self.radio_tab_left = gtk.RadioButton(None, _("Left")) self.radio_tab_left.show() self.radio_tab_top = gtk.RadioButton(self.radio_tab_left, _("Top")) self.radio_tab_top.show() self.radio_tab_no = gtk.RadioButton(self.radio_tab_left, _("No Tabs")) self.radio_tab_no.show() pbox.pack_start(label, False, False, 0) pbox.pack_start(self.radio_tab_left, False, False, 0) pbox.pack_start(self.radio_tab_top, False, False, 0) pbox.pack_start(self.radio_tab_no, False, False, 0) """closed type """ close_label_box = gtk.HBox(False, 10) close_label_box.show() close_label = gtk.Label(_("Close tab sign:")) close_label.set_size_request(150, -1) close_label.show() self.radio_tab_label = gtk.RadioButton(None, "x") self.radio_tab_label.show() self.radio_tab_button = gtk.RadioButton(self.radio_tab_label, None) self.radio_tab_button.show() self.tab_close_box = gtk.HBox() self.tab_close_box.pack_start(self.radio_tab_button, False, True, 0) self.tab_close_box.pack_start(tab_close_button(), False, False, 0) self.tab_close_box.show() self.radio_tab_none = gtk.RadioButton(self.radio_tab_label, _("None")) self.radio_tab_none.show() close_label_box.pack_start(close_label, False, False, 0) close_label_box.pack_start(self.radio_tab_label, False, False, 0) close_label_box.pack_start(self.tab_close_box, False, False, 0) close_label_box.pack_start(self.radio_tab_none, False, False, 0) """global pack""" box.pack_start(cbox, False, True, 0) box.pack_start(lbox, False, True, 0) box.pack_start(pbox, False, True, 0) box.pack_start(close_label_box, False, True, 0) self.widget = box