[almanah] UI: Main entry text widget fixed width



commit 7f79c8df0f387d073556ada0bfe3d5eeb4b5665f
Author: Álvaro Peña <alvaropg gmail com>
Date:   Sun Sep 20 20:52:26 2015 +0200

    UI: Main entry text widget fixed width
    
    The GtkTextView has been centered into a GtkEventBox, which allow us to
    draw the background with the same color of the GtkTextView, so the space
    around the GtkTextView looks like paper.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754841

 src/css/almanah.css |    4 ++++
 src/ui/almanah.ui   |   34 ++++++++++++++++++++++++----------
 2 files changed, 28 insertions(+), 10 deletions(-)
---
diff --git a/src/css/almanah.css b/src/css/almanah.css
index b953df6..44361db 100644
--- a/src/css/almanah.css
+++ b/src/css/almanah.css
@@ -14,3 +14,7 @@ AlmanahTagEntry:focused {
     border-left-width: 0px;
     border-right-width: 0px;
 }
+
+.almanah-mw-text-event-box {
+    background-color: #fff;
+}
diff --git a/src/ui/almanah.ui b/src/ui/almanah.ui
index 75f293b..281032a 100644
--- a/src/ui/almanah.ui
+++ b/src/ui/almanah.ui
@@ -115,16 +115,30 @@
                                                                        <class name="almanah-mw-scrolled"/>
                                                                </style>
                                                                <child>
-                                                                       <object class="GtkTextView" 
id="almanah_mw_entry_view">
-                                                                               <property 
name="width-request">300</property>
-                                                                               <property 
name="can-focus">True</property>
-                                                                               <property 
name="has-focus">True</property>
-                                                                               <property 
name="wrap-mode">GTK_WRAP_WORD</property>
-                                                                               <property 
name="left-margin">6</property>
-                                                                               <property 
name="right-margin">6</property>
-                                                                               <child 
internal-child="accessible">
-                                                                                       <object 
class="AtkObject" id="a11y-almanah_mw_entry_view">
-                                                                                               <property 
name="AtkObject::accessible-name" translatable="yes">Entry editing area</property>
+                                                                       <object class="GtkEventBox" 
id="almanah_mw_text_event_box">
+                                                                               <property 
name="visible">True</property>
+                                                                               <property 
name="can_focus">False</property>
+                                                                               <style>
+                                                                                       <class 
name="almanah-mw-text-event-box"/>
+                                                                               </style>
+                                                                               <child>
+                                                                                       <object 
class="GtkTextView" id="almanah_mw_entry_view">
+                                                                                         <style>
+                                                                                           <class 
name="almanah-mw-entry-view"/>
+                                                                                         </style>
+                                                                                               <property 
name="width-request">500</property>
+                                                                                               <property 
name="can-focus">True</property>
+                                                                                               <property 
name="has-focus">True</property>
+                                                                                               <property 
name="wrap-mode">GTK_WRAP_WORD</property>
+                                                                                               <property 
name="halign">center</property>
+                                                                                               <property 
name="hexpand">False</property>
+                                                                                               <property 
name="vexpand">True</property>
+                                                                                               <property 
name="margin">12</property>
+                                                                                               <child 
internal-child="accessible">
+                                                                                                       
<object class="AtkObject" id="a11y-almanah_mw_entry_view">
+                                                                                                             
  <property name="AtkObject::accessible-name" translatable="yes">Entry editing area</property>
+                                                                                                       
</object>
+                                                                                               </child>
                                                                                        </object>
                                                                                </child>
                                                                        </object>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]