[fractal/fractal-next] message_entry: Remove custom styles



commit fba4b1c2341be0079f4a7402e25711fc8cf28977
Author: Kai A. Hiller <V02460 gmail com>
Date:   Tue Aug 24 13:00:16 2021 +0200

    message_entry: Remove custom styles

 data/resources/style.css                  | 12 ++----------
 data/resources/ui/content-room-history.ui | 28 ++++++++++++++++------------
 src/session/content/room_history.rs       |  8 +++++---
 3 files changed, 23 insertions(+), 25 deletions(-)
---
diff --git a/data/resources/style.css b/data/resources/style.css
index 95bae3f1..b291ab32 100644
--- a/data/resources/style.css
+++ b/data/resources/style.css
@@ -176,16 +176,8 @@ headerbar.flat {
   margin: 6px;
 }
 
-.message-entry > .view {
-  background-color: @theme_base_color;
-  border-radius: 5px;
-  border: 1px solid @borders;
-  padding: 6px;
-}
-
-.message-entry > .view:focus {
-  border: 2px solid @accent_bg_color;
-  padding: 5px;
+.message-entry .view {
+  padding: 7px 0;
 }
 
 .invite-room-name {
diff --git a/data/resources/ui/content-room-history.ui b/data/resources/ui/content-room-history.ui
index 1aeb166e..804e3d93 100644
--- a/data/resources/ui/content-room-history.ui
+++ b/data/resources/ui/content-room-history.ui
@@ -153,20 +153,24 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkScrolledWindow">
-                    <property name="vexpand">True</property>
-                    <property name="hexpand">True</property>
-                    <property name="vscrollbar-policy">external</property>
-                    <property name="max-content-height">200</property>
-                    <property name="propagate-natural-height">True</property>
-                    <property name="child">
-                      <object class="GtkSourceView" id="message_entry">
-                        <property name="hexpand">True</property>
-                      </object>
-                    </property>
+                  <object class="CustomEntry">
                     <style>
-                      <class name="message-entry"/>
+                      <class name="message-entry" />
                     </style>
+                    <child>
+                      <object class="GtkScrolledWindow">
+                        <property name="vexpand">True</property>
+                        <property name="hexpand">True</property>
+                        <property name="vscrollbar-policy">external</property>
+                        <property name="max-content-height">200</property>
+                        <property name="propagate-natural-height">True</property>
+                        <property name="child">
+                          <object class="GtkSourceView" id="message_entry">
+                            <property name="hexpand">True</property>
+                          </object>
+                        </property>
+                      </object>
+                    </child>
                   </object>
                 </child>
                 <child>
diff --git a/src/session/content/room_history.rs b/src/session/content/room_history.rs
index d25e3a07..3830de98 100644
--- a/src/session/content/room_history.rs
+++ b/src/session/content/room_history.rs
@@ -1,6 +1,3 @@
-use crate::components::RoomTitle;
-use crate::session::content::RoomDetails;
-use crate::session::{content::ItemRow, content::MarkdownPopover, room::Room, room::RoomType};
 use adw::subclass::prelude::*;
 use gtk::{
     gdk, glib, glib::clone, glib::signal::Inhibit, prelude::*, subclass::prelude::*,
@@ -8,6 +5,10 @@ use gtk::{
 };
 use sourceview::prelude::*;
 
+use crate::components::{CustomEntry, RoomTitle};
+use crate::session::content::{ItemRow, MarkdownPopover, RoomDetails};
+use crate::session::room::{Room, RoomType};
+
 mod imp {
     use super::*;
     use crate::Application;
@@ -49,6 +50,7 @@ mod imp {
         type ParentType = adw::Bin;
 
         fn class_init(klass: &mut Self::Class) {
+            CustomEntry::static_type();
             ItemRow::static_type();
             MarkdownPopover::static_type();
             Self::bind_template(klass);


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