Prechádzať zdrojové kódy

Use common style context for the entire GdkScreen

Matthias Vogelgesang 7 rokov pred
rodič
commit
ac74dbfd94
4 zmenil súbory, kde vykonal 19 pridanie a 9 odobranie
  1. 0 1
      src/iridium-tag-row.ui
  2. 1 4
      src/iridium-window.c
  3. 9 0
      src/iridium-window.ui
  4. 9 4
      src/iridium.css

+ 0 - 1
src/iridium-tag-row.ui

@@ -12,7 +12,6 @@
             <property name="halign">GTK_ALIGN_START</property>
             <property name="margin-bottom">3</property>
             <attributes>
-              <attribute name="scale" value="1.3"/>
               <attribute name="weight" value="bold"/>
             </attributes>
           </object>

+ 1 - 4
src/iridium-window.c

@@ -172,10 +172,7 @@ iridium_window_init (IridiumWindow *self)
 
   provider = GTK_STYLE_PROVIDER (gtk_css_provider_get_default ());
   gtk_css_provider_load_from_resource (GTK_CSS_PROVIDER (provider), "/net/bloerg/Iridium/iridium.css");
-  gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (self)), provider, GTK_STYLE_PROVIDER_PRIORITY_USER);
-  gtk_style_context_add_provider (gtk_widget_get_style_context (self->source_view), provider, GTK_STYLE_PROVIDER_PRIORITY_USER);
-  gtk_style_context_add_provider (gtk_widget_get_style_context (self->title_entry), provider, GTK_STYLE_PROVIDER_PRIORITY_USER);
-  gtk_style_context_add_provider (gtk_widget_get_style_context (self->main_pane), provider, GTK_STYLE_PROVIDER_PRIORITY_USER);
+  gtk_style_context_add_provider_for_screen (gtk_window_get_screen (GTK_WINDOW (self)), provider, GTK_STYLE_PROVIDER_PRIORITY_USER);
 
   gtk_list_box_insert (self->note_list, iridium_note_row_new (notes[0]), -1);
   gtk_list_box_insert (self->note_list, iridium_note_row_new (notes[1]), -1);

+ 9 - 0
src/iridium-window.ui

@@ -49,6 +49,7 @@
         </child>
         <child>
           <object class="GtkPaned" id="main_pane">
+            <property name="name">main-pane</property>
             <property name="visible">True</property>
             <child>
               <object class="GtkBox">
@@ -58,12 +59,18 @@
                   <object class="GtkListBox" id="tag_list">
                     <property name="visible">True</property>
                     <property name="expand">True</property>
+                    <style>
+                      <class name="list-box"/>
+                    </style>
                   </object>
                 </child>
                 <child>
                   <object class="GtkListBox" id="note_list">
                     <property name="visible">True</property>
                     <property name="expand">True</property>
+                    <style>
+                      <class name="list-box"/>
+                    </style>
                   </object>
                 </child>
               </object>
@@ -74,6 +81,7 @@
                 <property name="orientation">GTK_ORIENTATION_VERTICAL</property>
                 <child>
                   <object class="GtkEntry" id="title_entry">
+                    <property name="name">title-entry</property>
                     <property name="visible">True</property>
                     <property name="placeholder-text">Add title …</property>
                     <property name="margin-top">6</property>
@@ -89,6 +97,7 @@
                     <property name="margin">12</property>
                     <child>
                       <object class="GtkSourceView" id="source_view">
+                        <property name="name">source-view</property>
                         <property name="visible">True</property>
                         <property name="expand">True</property>
                       </object>

+ 9 - 4
src/iridium.css

@@ -1,15 +1,20 @@
-GtkSourceView {
+GtkSourceView#source-view {
   font-family: "Fira Mono", monospace;
   font-size: 1.05em;
 }
 
-GtkEntry {
+GtkEntry#title-entry {
   border: none;
   background: none;
   font-size: x-large;
   font-weight: bold;
 }
 
-GtkPaned {
-  background-color: white;
+GtkPaned#main-pane {
+  background: white;
+  border: 1px solid #ccc;
+}
+
+.list-box > IridiumNoteRow:not(:last-child) {
+  border-bottom: 1px solid #ccc;
 }