def __init__(self):
     gtk.VBox.__init__(self)
     
     self.set_spacing(10)
     self.local_view_page = LocalSearchView(local_search_tab)
     
     self.close_button = SearchCloseButton()
     self.line_dcolor = app_theme.get_color("globalItemHighlight")
     close_button_align = set_widget_gravity(self.close_button, gravity=(0.5, 0.5, 0, 0),
                                             paddings=(0, 0, 5, 10))
     close_button_align.connect("expose-event",  self.on_close_button_expose_event)
     
     self.tab_switcher = TabSwitcher([TabItem(_("Library"), self.local_view_page)])
     self.tab_switcher.connect("tab-switch-start", lambda switcher, tab_index: self.switch_result_view(tab_index))
     tab_switcher_align = set_widget_gravity(self.tab_switcher, gravity=(0, 0, 1, 1),
                                             paddings=(10, 0, 0, 0))
     tab_switcher_box = gtk.HBox()
     tab_switcher_box.pack_start(tab_switcher_align, True, True)
     tab_switcher_box.pack_start(close_button_align, False, False)
     
     self.result_page = gtk.VBox()
     self.result_page.add(self.local_view_page)
     
     self.pack_start(tab_switcher_box, False, True)
     self.pack_start(self.result_page, True, True)
     
     Dispatcher.connect("add-search-view", self.on_dispatcher_add_search_view)
     Dispatcher.connect("remove-search-view", self.on_dispatcher_remove_search_view)
     Dispatcher.connect("switch-browser", self.on_list_manager_switch_browser)
 def init_listview_page(self):    
     self.listview_page = gtk.VBox()
     self.text_prompt = TextPrompt("Default")
     prompt_align = set_widget_gravity(self.text_prompt, 
                                       paddings=(10, 10, 0, 0))
     prompt_box = gtk.HBox()
     back_button = BackButton()
     back_button.connect("clicked", self.on_backbutton_clicked)
     back_button_align = set_widget_gravity(back_button, gravity=(0.5, 0.5, 0, 0),
                                            paddings=(0, 0, 10, 5))
     prompt_box.pack_start(back_button_align, False, True)
     prompt_box.pack_start(prompt_align, False, False)
     
     self.listview_page.pack_start(prompt_box, False, True)
     self.listview_page.pack_start(self.webcast_view_sw, True, True)
Beispiel #3
0
 def __init__(self,  content=""):
     '''
     Initialize InputEntry class.
     '''
     # Init.
     gtk.VBox.__init__(self)
     clean_button = CleanButton()
     clean_button.connect("clicked", self.on_clean_clicked)
     self.entry = Entry(content, place_holder=_("Need some music? Find it here..."))
     entry_align = gtk.Alignment()
     entry_align.set(0.5, 0.5, 1, 1)
     entry_align.add(self.entry)
     
     clean_box = gtk.HBox(spacing=5)
     clean_box.pack_start(entry_align, True, True)
     self.clean_button_align = set_widget_gravity(clean_button, gravity=(0.5, 0.5, 0, 0),
                                             paddings=(0, 0, 0, 5))
     self.clean_button_align.set_no_show_all(True)
     
     clean_box.pack_start(self.clean_button_align, False, False)
     self.add(clean_box)
     
     self.entry.connect("press-return", self.__emit_enter_signal)
     self.entry.connect("changed", self.__on_entry_changed)
     self.connect("expose-event", self.expose_input_entry)
    def init_listview_page(self):
        self.listview_page = gtk.VBox()
        self.text_prompt = TextPrompt("Default")
        prompt_align = set_widget_gravity(self.text_prompt,
                                          paddings=(10, 10, 0, 0))
        prompt_box = gtk.HBox()
        back_button = BackButton()
        back_button.connect("clicked", self.on_backbutton_clicked)
        back_button_align = set_widget_gravity(back_button,
                                               gravity=(0.5, 0.5, 0, 0),
                                               paddings=(0, 0, 10, 5))
        prompt_box.pack_start(back_button_align, False, True)
        prompt_box.pack_start(prompt_align, False, False)

        self.listview_page.pack_start(prompt_box, False, True)
        self.listview_page.pack_start(self.webcast_view_sw, True, True)
 def __init__(self):
     gtk.VBox.__init__(self)
     
     self.set_spacing(5)
     self.plugins = utils.get_main_window().plugins
     self.plugins_view = TreeView()
     self.plugins_view.add_items = self.plugins_view_add_items
     self.plugins_view.set_expand_column(0)
     self.plugins_view.draw_mask = self.plugins_view_draw_mask
     self.plugins_view.set_size_request(420, 330)        
     self.plugins_view.connect("single-click-item", self.on_plugins_view_single_click)
     self.plugins_view.connect("press-return", self.on_plugins_view_press_return)
             
     self.plugins_view.set_column_titles([_("Name"), _("Version"), _("Enable"), ""],
                                         (self.sort_by_title, self.sort_by_title,
                                          self.sort_by_title, self.sort_by_title))
     plugins_view_align = set_widget_gravity(self.plugins_view, gravity=(1, 1, 1, 1),
                                             paddings=(10, 0, 0, 0))
     
     self.plugin_infos = PluginInfos()
     self.plugin_infos.set_size_request(420, 90)
     
     # plugin info
     self.pack_start(plugins_view_align, False, True)
     self.pack_start(self.plugin_infos, False, True)
    def __init__(self):
        gtk.VBox.__init__(self)

        self.set_spacing(10)
        self.local_view_page = LocalSearchView(local_search_tab)

        self.close_button = SearchCloseButton()
        self.line_dcolor = app_theme.get_color("globalItemHighlight")
        close_button_align = set_widget_gravity(self.close_button,
                                                gravity=(0.5, 0.5, 0, 0),
                                                paddings=(0, 0, 5, 10))
        close_button_align.connect("expose-event",
                                   self.on_close_button_expose_event)

        self.tab_switcher = TabSwitcher(
            [TabItem(_("Library"), self.local_view_page)])
        self.tab_switcher.connect(
            "tab-switch-start",
            lambda switcher, tab_index: self.switch_result_view(tab_index))
        tab_switcher_align = set_widget_gravity(self.tab_switcher,
                                                gravity=(0, 0, 1, 1),
                                                paddings=(10, 0, 0, 0))
        tab_switcher_box = gtk.HBox()
        tab_switcher_box.pack_start(tab_switcher_align, True, True)
        tab_switcher_box.pack_start(close_button_align, False, False)

        self.result_page = gtk.VBox()
        self.result_page.add(self.local_view_page)

        self.pack_start(tab_switcher_box, False, True)
        self.pack_start(self.result_page, True, True)

        Dispatcher.connect("add-search-view",
                           self.on_dispatcher_add_search_view)
        Dispatcher.connect("remove-search-view",
                           self.on_dispatcher_remove_search_view)
        Dispatcher.connect("switch-browser",
                           self.on_list_manager_switch_browser)
Beispiel #7
0
    def __init__(self):
        Window.__init__(self,
                        window_type=gtk.WINDOW_POPUP,
                        shape_frame_function=self.shape_mini_frame,
                        expose_frame_function=self.expose_mini_frame)
        
        self.set_property("skip-pager-hint", True)
        self.set_property("skip-taskbar-hint", True)
        
        self.body_box = gtk.VBox()
        
        self.control_box = gtk.HBox()
        self.action_box = gtk.HBox()
        self.event_box = gtk.HBox()  
        self.info_box = gtk.HBox()              

        # Build info box
        self.logo_padding_left = 10
        self.logo_padding_right = 10
        logo_box = self.create_logo_box()
        logo_box_align = set_widget_gravity(logo_box, (0.5, 0.5, 0, 0),
                                            (0, 0, self.logo_padding_left,
                                             self.logo_padding_right))
        self.playinfo = PlayInfo(239, None, 0, "#000000")
        self.info_box.pack_start(logo_box_align, False, False)
        self.info_box.pack_start(self.playinfo, False, False)
        
        # Build control box
        self.lyrics_button = self.create_lyrics_button()
        self.signal_auto = False        
        if config.getboolean("lyrics", "status"):
            self.lyrics_button.set_active(True)
        self.signal_auto = True    
        
        
        self.lyrics_padding_left = 10
        self.lyrics_padding_right = 8
        lyrics_button_align = set_widget_gravity(self.lyrics_button, (0.5, 0.5, 0, 0),
                                                 (0, 0, self.lyrics_padding_left,
                                                  self.lyrics_padding_right))
        
        self.previous_button = self.create_button("previous")
        self.next_button = self.create_button("next")
        self.playpause_button = self.create_playpause_button()
        
        # swap played status handler
        self.__id_signal_play = self.playpause_button.connect("toggled", self.on_player_playpause)        
        Player.connect("played", self.__swap_play_status, True)
        Player.connect("paused", self.__swap_play_status, False)
        Player.connect("stopped", self.__swap_play_status, False)
        Player.connect("play-end", self.__swap_play_status, False)
        
        self.volume_slider = VolumeSlider(auto_hide=False, mini_mode=True)
        self.volume_padding_left = 8
        volume_slider_align = set_widget_gravity(self.volume_slider, (0.5, 0.5, 0, 0),
                                                 (0, 0, self.volume_padding_left, 0))
        
        self.action_box.pack_start(lyrics_button_align, False, False)
        self.action_box.pack_start(set_widget_vcenter(self.previous_button), False, False)
        self.action_box.pack_start(set_widget_vcenter(self.playpause_button), False, True)
        self.action_box.pack_start(set_widget_vcenter(self.next_button), False, False)
        self.action_box.pack_start(volume_slider_align, False, False)
        
        # Build event box.
        quell_button = QuellButton()
        quell_button.connect("clicked", self.on_quell_button_clicked)
        
        min_button = MinButton()
        min_button.connect("clicked", lambda w: self.min_window())
        close_button = CloseButton()
        close_button.connect("clicked", self.try_to_quit)
        self.event_box.pack_start(quell_button, False, False)
        self.event_box.pack_start(min_button, False, False)
        self.event_box.pack_start(close_button, False, False)
        event_box_align = set_widget_gravity(self.event_box, paddings=(0, 0, 8, 0))
        
        self.control_box.pack_start(self.action_box, False, True)
        self.control_box.pack_end(event_box_align, False, True)
        
        self.connect("configure-event", self.on_configure_event)
        self.connect("enter-notify-event", self.on_enter_notify_event)
        self.connect("leave-notify-event", self.on_leave_notify_event)
        self.connect("button-press-event", self.on_button_press_event)
        self.connect("motion-notify-event", self.on_motion_notify_event)
        self.connect("button-release-event", self.on_button_release_event)
        
        Dispatcher.connect("close-lyrics", lambda w : self.lyrics_button.set_active(False))
        Dispatcher.connect("show-lyrics", lambda w: self.lyrics_button.set_active(True))
        
        if config.get("mini", "x") == "-1":
            self.set_position(gtk.WIN_POS_CENTER)
        else:    
            self.move(int(config.get("mini","x")),int(config.get("mini","y")))
            
        # pixbufs    
        self.info_pixbuf = None
        self.control_pixbuf = None

        self.body_box.add(self.info_box)    
        self.window_frame.add(self.body_box)
        self.set_size_request(305, 40)
        
        
        # animation params.
        self.active_alpha = 1.0
        self.target_alpha = 0.0
        self.in_animation = False
        self.animation_time = 1000
        self.animation_timeout_id = None
        self.draw_animation = False
        self.active_draw_func = None
        self.target_draw_func = None
        
        # drag params.
        self.drag_move = False
        self.old_x = self.old_y = self.mouse_x = self.mouse_y = 0