def __init__(self, controller, model): AbstractCuemiacView.__init__(self, controller, model) gtk.Window.__init__(self) self._controller.register_view(self) self.__small_window_height = None self.connect("configure-event", self.__save_window_size) self.connect("delete-event", self._controller.on_quit) self.connect("destroy-event", self._controller.on_quit) self.connect("focus-out-event", self._controller.on_quit) self.connect("key-press-event", self.__on_window_key_press_event) self.set_title("Deskbar Applet") self.set_default_size( self._model.get_window_width(), -1 ) self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG) self.set_role("deskbar-search-window") self.set_property("skip-taskbar-hint", True) # Reset width to default self.get_entry().set_width_chars(-1) self.add(self.vbox_main) # Search entry self.vbox_main.pack_start(self.header, False) # Results self.results_box = gtk.HBox() self.results_box.connect("unmap", self.__save_window_height) self.results_box.pack_start(self.scrolled_results) self.results_box.pack_start(self.actions_box) self.vbox_main.pack_start(self.results_box)
def __init__(self, controller, model, widget, applet): AbstractCuemiacView.__init__(self, controller, model) CuemiacAlignedWindow.__init__(self, widget, applet) self._controller.register_view(self) self.applet = applet GconfStore.get_instance().connect( "entry-width-changed", lambda s, w: self._change_entry_width(w)) self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_MENU) self.applet.set_applet_flags(mateapplet.EXPAND_MINOR) self.applet.set_flags(gtk.CAN_FOCUS) self.applet.connect("change-orient", self._on_change_orient) self._screen_height = self.get_screen().get_height() self._screen_width = self.get_screen().get_width() self._max_window_height = int(0.8 * self._screen_height) self._max_window_width = int(0.6 * self._screen_width) self.connect("delete-event", self._controller.on_quit) self.connect("destroy-event", self._controller.on_quit) self.connect("focus-out-event", self._controller.on_quit) self.connect("key-press-event", self.__on_window_key_press_event) self.set_title("Deskbar Applet") self.set_default_size(self._model.get_window_width(), -1) self.set_role("deskbar-search-window") entry_width = self._model.get_entry_width() # Account for previous default entry width of 20 if entry_width == 20: entry_width = 40 self._model.set_entry_width(entry_width) self._change_entry_width(entry_width) # VBox self.add(self.vbox_main) # Results self.results_box = gtk.HBox() self.results_box.pack_start(self.scrolled_results) self.results_box.pack_start(self.actions_box) self.__set_layout_by_orientation(self.applet.get_orient()) self.resize(*self.size_request())
def __init__(self, controller, model, widget, applet): AbstractCuemiacView.__init__(self, controller, model) CuemiacAlignedWindow.__init__(self, widget, applet) self._controller.register_view(self) self.applet = applet GconfStore.get_instance().connect("entry-width-changed", lambda s, w: self._change_entry_width(w)) self.set_type_hint (gtk.gdk.WINDOW_TYPE_HINT_MENU) self.applet.set_applet_flags(mateapplet.EXPAND_MINOR) self.applet.set_flags(gtk.CAN_FOCUS) self.applet.connect("change-orient", self._on_change_orient) self._screen_height = self.get_screen().get_height () self._screen_width = self.get_screen().get_width () self._max_window_height = int (0.8 * self._screen_height) self._max_window_width = int (0.6 * self._screen_width) self.connect("delete-event", self._controller.on_quit) self.connect("destroy-event", self._controller.on_quit) self.connect("focus-out-event", self._controller.on_quit) self.connect("key-press-event", self.__on_window_key_press_event) self.set_title("Deskbar Applet") self.set_default_size( self._model.get_window_width(), -1 ) self.set_role("deskbar-search-window") entry_width = self._model.get_entry_width() # Account for previous default entry width of 20 if entry_width == 20: entry_width = 40 self._model.set_entry_width(entry_width) self._change_entry_width(entry_width) # VBox self.add(self.vbox_main) # Results self.results_box = gtk.HBox() self.results_box.pack_start(self.scrolled_results) self.results_box.pack_start(self.actions_box) self.__set_layout_by_orientation(self.applet.get_orient()) self.resize( *self.size_request() )