Ejemplo n.º 1
0
 def change_font(self, *a):
     ls = [self.tree_add, self.tree_add_doc]
     for a in ls:
         szfont, fmfont = asm_customs.split_font(
             self.parent.theme.font_lists_books)
         data = '''
         * {
         font-family: "''' + fmfont + '''";
         font-size: ''' + szfont + '''px;
         }
         #Tree:selected {
         color: ''' + asm_customs.rgb(
             self.parent.theme.color_selected) + ''';
         background-color: ''' + asm_customs.rgb(
                 self.parent.theme.background_selected) + ''';
         }
         #Tree:hover {
         color: ''' + asm_customs.rgb(self.parent.theme.color_hover) + ''';
         background-color: ''' + asm_customs.rgb(
                     self.parent.theme.background_hover) + ''';
         }
         #Tree {
         color: ''' + asm_customs.rgb(
                         self.parent.theme.color_lists_books) + ''';
         background-color: ''' + asm_customs.rgb(
                             self.parent.theme.background_lists_books
                         ) + ''';
         }'''
         css_provider = Gtk.CssProvider()
         context = a.get_style_context()
         css_provider.load_from_data(data.encode('utf8'))
         context.add_provider(css_provider,
                              Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
Ejemplo n.º 2
0
 def change_font(self, *a):
     ls0 = [self.tree_results]
     for a in ls0:
         szfont, fmfont = asm_customs.split_font(
             self.parent.theme.font_lists_titles)
         data = '''
         * {
         font-family: "''' + fmfont + '''";
         font-size: ''' + szfont + '''px;
         }
         #Tree:selected {
         color: ''' + asm_customs.rgb(
             self.parent.theme.color_selected) + ''';
         background-color: ''' + asm_customs.rgb(
                 self.parent.theme.background_selected) + ''';
         }
         #Tree:hover {
         color: ''' + asm_customs.rgb(self.parent.theme.color_hover) + ''';
         background-color: ''' + asm_customs.rgb(
                     self.parent.theme.background_hover) + ''';
         }
         #Tree {
         color: ''' + asm_customs.rgb(
                         self.parent.theme.color_lists_titles) + ''';
         background-color: ''' + asm_customs.rgb(
                             self.parent.theme.background_lists_titles
                         ) + ''';
         }'''
         css_provider = Gtk.CssProvider()
         context = a.get_style_context()
         css_provider.load_from_data(data.encode('utf8'))
         context.add_provider(css_provider,
                              Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
     #---------------------------------------------------
     ls1 = [self.view_nasse]
     for a in ls1:
         szfont, fmfont = asm_customs.split_font(
             self.parent.theme.font_nasse_books)
         data = '''
         * {
         font-family: "''' + fmfont + '''";
         font-size: ''' + szfont + '''px;
         color: ''' + asm_customs.rgb(
             self.parent.theme.color_nasse_books) + ''';
         background-color: ''' + asm_customs.rgb(
                 self.parent.theme.background_nasse_books) + ''';
         }
         #View text selection, #View:selected  {
         color: ''' + asm_customs.rgb(
                     self.parent.theme.color_selected) + ''';
         background-color: ''' + asm_customs.rgb(
                         self.parent.theme.background_selected) + ''';
         }
         '''
         css_provider = Gtk.CssProvider()
         context = a.get_style_context()
         css_provider.load_from_data(data.encode('utf8'))
         context.add_provider(css_provider,
                              Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
     #---------------------------------------------------
     self.view_title_tag.set_property('foreground',
                                      self.parent.theme.color_anawin)
     self.view_quran_tag.set_property('foreground',
                                      self.parent.theme.color_quran)
     self.view_terms_tag.set_property('foreground',
                                      self.parent.theme.color_anawin)
     self.view_search_tag.set_property('foreground',
                                       self.parent.theme.color_searched)
     self.view_title_tag.set_property('font', self.parent.theme.font_anawin)
     self.view_quran_tag.set_property('font', self.parent.theme.font_quran)
     self.view_title_tag.set_property('background',
                                      self.parent.theme.background_anawin)
     self.view_quran_tag.set_property('paragraph-background',
                                      self.parent.theme.background_quran)
     self.view_terms_tag.set_property('background',
                                      self.parent.theme.background_anawin)
     self.view_search_tag.set_property(
         'background', self.parent.theme.background_searched)
Ejemplo n.º 3
0
 def change_font(self, *a):
     ls = [self.list_books.tree_parts, self.organize.tree_group]
     for a in ls:
         szfont, fmfont = asm_customs.split_font(
             self.theme.font_lists_parts)
         data = '''
         * {
         font-family: "''' + fmfont + '''";
         font-size: ''' + szfont + '''px;
         }
         #Tree:selected {
         color: ''' + asm_customs.rgb(self.theme.color_selected) + ''';
         background-color: ''' + asm_customs.rgb(
             self.theme.background_selected) + ''';
         }
         #Tree:hover {
         color: ''' + asm_customs.rgb(self.theme.color_hover) + ''';
         background-color: ''' + asm_customs.rgb(
                 self.theme.background_hover) + ''';
         }
         #Tree {
         color: ''' + asm_customs.rgb(self.theme.color_lists_parts) + ''';
         background-color: ''' + asm_customs.rgb(
                     self.theme.background_lists_parts) + ''';
         }'''
         css_provider = Gtk.CssProvider()
         context = a.get_style_context()
         css_provider.load_from_data(data.encode('utf8'))
         context.add_provider(css_provider,
                              Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
     #-----------------------------------------
     ls = [self.list_books.tree_books, self.organize.tree_books]
     for a in ls:
         szfont, fmfont = asm_customs.split_font(
             self.theme.font_lists_books)
         data = '''
         * {
         font-family: "''' + fmfont + '''";
         font-size: ''' + szfont + '''px;
         }
         #Tree:selected {
         color: ''' + asm_customs.rgb(self.theme.color_selected) + ''';
         background-color: ''' + asm_customs.rgb(
             self.theme.background_selected) + ''';
         }
         #Tree:hover {
         color: ''' + asm_customs.rgb(self.theme.color_hover) + ''';
         background-color: ''' + asm_customs.rgb(
                 self.theme.background_hover) + ''';
         }
         #Tree {
         color: ''' + asm_customs.rgb(self.theme.color_lists_books) + ''';
         background-color: ''' + asm_customs.rgb(
                     self.theme.background_lists_books) + ''';
         }'''
         css_provider = Gtk.CssProvider()
         context = a.get_style_context()
         css_provider.load_from_data(data.encode('utf8'))
         context.add_provider(css_provider,
                              Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
     #-----------------------------------------
     ls = [self.list_books.iconview_parts]
     for a in ls:
         szfont, fmfont = asm_customs.split_font(
             self.theme.font_lists_parts)
         data = '''
         * {
         font-family: "''' + fmfont + '''";
         font-size: ''' + szfont + '''px;
         color: ''' + asm_customs.rgb(self.theme.color_lists_parts) + ''';
         background-color: ''' + asm_customs.rgb(
             self.theme.background_lists_parts) + ''';
         }
         #iconview:selected {
         color: ''' + asm_customs.rgb(self.theme.color_selected) + ''';
         background-color: ''' + asm_customs.rgb(
                 self.theme.background_selected) + ''';
         }
         #iconview:hover {
         color: ''' + asm_customs.rgb(self.theme.color_hover) + ''';
         background-color: ''' + asm_customs.rgb(
                     self.theme.background_hover) + ''';
         }
         '''
         css_provider = Gtk.CssProvider()
         context = a.get_style_context()
         css_provider.load_from_data(data.encode('utf8'))
         context.add_provider(css_provider,
                              Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
     #-----------------------------------------
     ls = [self.list_books.iconview_books]
     for a in ls:
         szfont, fmfont = asm_customs.split_font(
             self.theme.font_lists_books)
         data = '''
         * {
         font-family: "''' + fmfont + '''";
         font-size: ''' + szfont + '''px;
         color: ''' + asm_customs.rgb(self.theme.color_lists_books) + ''';
         background-color: ''' + asm_customs.rgb(
             self.theme.background_lists_books) + ''';
         }
         #iconview:selected {
         color: ''' + asm_customs.rgb(self.theme.color_selected) + ''';
         background-color: ''' + asm_customs.rgb(
                 self.theme.background_selected) + ''';
         }
         #iconview:hover {
         color: ''' + asm_customs.rgb(self.theme.color_hover) + ''';
         background-color: ''' + asm_customs.rgb(
                     self.theme.background_hover) + ''';
         }
         '''
         css_provider = Gtk.CssProvider()
         context = a.get_style_context()
         css_provider.load_from_data(data.encode('utf8'))
         context.add_provider(css_provider,
                              Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
     #-----------------------------------------
     ls0 = [
         self.list_books.tree_favorite, self.list_books.tree_last,
         self.winspage.authorpage.tree_author, self.warakapage.tree_waraka,
         self.winspage.dictpage.tree_dict, self.tafsirpage.tree_search,
         self.winspage.tarjamapage.tree_tarjama, self.moshafpage.tree_index
     ]
     for a in ls0:
         szfont, fmfont = asm_customs.split_font(
             self.theme.font_lists_titles)
         data = '''
         * {
         font-family: "''' + fmfont + '''";
         font-size: ''' + szfont + '''px;
         }
         #Tree:selected {
         color: ''' + asm_customs.rgb(self.theme.color_selected) + ''';
         background-color: ''' + asm_customs.rgb(
             self.theme.background_selected) + ''';
         }
         #Tree:hover {
         color: ''' + asm_customs.rgb(self.theme.color_hover) + ''';
         background-color: ''' + asm_customs.rgb(
                 self.theme.background_hover) + ''';
         }
         #Tree {
         color: ''' + asm_customs.rgb(self.theme.color_lists_titles) + ''';
         background-color: ''' + asm_customs.rgb(
                     self.theme.background_lists_titles) + ''';
         }'''
         css_provider = Gtk.CssProvider()
         context = a.get_style_context()
         css_provider.load_from_data(data.encode('utf8'))
         context.add_provider(css_provider,
                              Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
     #-----------------------------------------
     ls1 = [self.list_books.view_info]
     for a in ls1:
         szfont, fmfont = asm_customs.split_font(
             self.theme.font_nasse_others)
         data = '''
         * {
         font-family: "''' + fmfont + '''";
         font-size: ''' + szfont + '''px;
         color: ''' + asm_customs.rgb(self.theme.color_nasse_others) + ''';
         background-color: ''' + asm_customs.rgb(
             self.theme.background_nasse_others) + ''';
         }
         #View text selection, #View:selected  {
         color: ''' + asm_customs.rgb(self.theme.color_selected) + ''';
         background-color: ''' + asm_customs.rgb(
                 self.theme.background_selected) + ''';
         }
         '''
         css_provider = Gtk.CssProvider()
         context = a.get_style_context()
         css_provider.load_from_data(data.encode('utf8'))
         context.add_provider(css_provider,
                              Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
     #-----------------------------------------
     ls2 = [
         self.winspage.authorpage.view_author,
         self.winspage.dictpage.view_dict,
         self.winspage.tarjamapage.view_tarjama, self.tafsirpage.view_tafsir
     ]
     for a in ls2:
         szfont, fmfont = asm_customs.split_font(
             self.theme.font_nasse_books)
         data = '''
         * {
         font-family: "''' + fmfont + '''";
         font-size: ''' + szfont + '''px;
         color: ''' + asm_customs.rgb(self.theme.color_nasse_books) + ''';
         background-color: ''' + asm_customs.rgb(
             self.theme.background_nasse_books) + ''';
         }
         #View text selection, #View:selected  {
         color: ''' + asm_customs.rgb(self.theme.color_selected) + ''';
         background-color: ''' + asm_customs.rgb(
                 self.theme.background_selected) + ''';
         }
         '''
         css_provider = Gtk.CssProvider()
         context = a.get_style_context()
         css_provider.load_from_data(data.encode('utf8'))
         context.add_provider(css_provider,
                              Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
     #-----------------------------------------
     ls3 = []
     for a in ls3:
         szfont, fmfont = asm_customs.split_font(self.theme.font_lists_side)
         data = '''
         * {
         font-family: "''' + fmfont + '''";
         font-size: ''' + szfont + '''px;
         }
         #Tree:selected {
         color: ''' + asm_customs.rgb(self.theme.color_selected) + ''';
         background-color: ''' + asm_customs.rgb(
             self.theme.background_selected) + ''';
         }
         #Tree:hover {
         color: ''' + asm_customs.rgb(self.theme.color_hover) + ''';
         background-color: ''' + asm_customs.rgb(
                 self.theme.background_hover) + ''';
         }
         #Tree {
         color: ''' + asm_customs.rgb(self.theme.color_lists_side) + ''';
         background-color: ''' + asm_customs.rgb(
                     self.theme.background_lists_side) + ''';
         }
         '''
         css_provider = Gtk.CssProvider()
         context = a.get_style_context()
         css_provider.load_from_data(data.encode('utf8'))
         context.add_provider(css_provider,
                              Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
     #----------------------------------------
     self.winspage.authorpage.view_author_tag.set_property(
         'foreground', self.theme.color_anawin)
     self.winspage.authorpage.view_author_tag.set_property(
         'background', self.theme.background_anawin)
     self.winspage.authorpage.view_author_tag.set_property(
         'font', self.theme.font_anawin)
     self.winspage.dictpage.search_tag.set_property(
         'foreground', self.theme.color_searched)
     self.winspage.dictpage.search_tag.set_property(
         'background', self.theme.background_searched)
     self.winspage.tarjamapage.view_tarjama_tag.set_property(
         'foreground', self.theme.color_anawin)
     self.winspage.tarjamapage.view_tarjama_tag.set_property(
         'background', self.theme.background_anawin)
     self.winspage.tarjamapage.view_tarjama_tag.set_property(
         'font', self.theme.font_anawin)
Ejemplo n.º 4
0
    def show_bitaka(self, *a):
        box = Gtk.Box(spacing=5, orientation=Gtk.Orientation.VERTICAL)
        bitaka_book = self.db.info_book()[3]
        info_book = self.db.info_book()[4]
        dlg = Gtk.Dialog(parent=self.parent)
        dlg.set_icon_name("asmaa")
        dlg.set_default_size(450, 300)
        area = dlg.get_content_area()
        area.set_spacing(6)

        hb_bar = Gtk.HeaderBar()
        hb_bar.set_show_close_button(True)
        dlg.set_titlebar(hb_bar)
        stack = Gtk.Stack()
        stack.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT_RIGHT)
        stack.set_transition_duration(1000)
        stack_switcher = Gtk.StackSwitcher()
        stack_switcher.set_stack(stack)
        hb_bar.set_custom_title(stack_switcher)

        self.view_info = asm_customs.ViewClass()
        self.view_info.set_name('View')
        self.view_info_bfr = self.view_info.get_buffer()
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.view_info)
        stack.add_titled(scroll, 'n1', ' بطاقة')
        self.view_info_bfr.set_text(bitaka_book)

        self.view_info1 = asm_customs.ViewClass()
        self.view_info1.set_name('View')
        self.view_info_bfr1 = self.view_info1.get_buffer()
        scroll = Gtk.ScrolledWindow()
        scroll.set_shadow_type(Gtk.ShadowType.IN)
        scroll.add(self.view_info1)
        stack.add_titled(scroll, 'n2', 'نبذة')
        self.view_info_bfr1.set_text(info_book)
        #-----------------------------------------
        ls2 = [self.view_info, self.view_info1]
        for a in ls2:
            szfont, fmfont = asm_customs.split_font(
                self.parent.theme.font_nasse_others)
            data = '''
            * {
            font-family: "''' + fmfont + '''";
            font-size: ''' + szfont + '''px;
            color: ''' + asm_customs.rgb(
                self.parent.theme.color_nasse_others) + ''';
            background-color: ''' + asm_customs.rgb(
                    self.parent.theme.background_nasse_others) + ''';
            }
            #View text selection, #View:selected  {
            color: ''' + asm_customs.rgb(
                        self.parent.theme.color_selected) + ''';
            background-color: ''' + asm_customs.rgb(
                            self.parent.theme.background_selected) + ''';
            }
            '''
            css_provider = Gtk.CssProvider()
            context = a.get_style_context()
            css_provider.load_from_data(data.encode('utf8'))
            context.add_provider(css_provider,
                                 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
        box.pack_start(stack, True, True, 0)
        area.pack_start(box, True, True, 0)
        dlg.show_all()