[gnome-contacts] build: moved css tweaks from gnome-themes-standard
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] build: moved css tweaks from gnome-themes-standard
- Date: Mon, 2 Jun 2014 17:45:35 +0000 (UTC)
commit f4e2dfb5f4d3eb58a27e48ce3b14a502373a0466
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Sat May 31 15:32:07 2014 -0400
build: moved css tweaks from gnome-themes-standard
It's easier to fix styling issues if the css code is hosted at
gnome-contacts git repository
data/Makefile.am | 1 +
data/contacts.gresource.xml | 1 +
data/ui/style.css | 138 +++++++++++++++++++++++++++++++++++++++++++
src/contacts-app.vala | 6 ++
src/contacts-utils.vala | 11 ++++
5 files changed, 157 insertions(+), 0 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index bd637b1..7fa7314 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -32,6 +32,7 @@ EXTRA_DIST = \
ui/app-menu.ui \
ui/contacts-window.ui \
ui/contacts-list-pane.ui \
+ ui/style.css \
$(appdata_in_files) \
$(searchprovider_DATA) \
$(service_in_files) \
diff --git a/data/contacts.gresource.xml b/data/contacts.gresource.xml
index 6e1c6ff..2b1ba03 100644
--- a/data/contacts.gresource.xml
+++ b/data/contacts.gresource.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/contacts">
+ <file compressed="true">ui/style.css</file>
<file compressed="true" preprocess="xml-stripblanks">ui/app-menu.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/contacts-window.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/contacts-list-pane.ui</file>
diff --git a/data/ui/style.css b/data/ui/style.css
new file mode 100644
index 0000000..febdeca
--- /dev/null
+++ b/data/ui/style.css
@@ -0,0 +1,138 @@
+/*
+ * GNOME Contacts
+ */
+
+/* Line at top in contacts pane, similar to .documents-scrolledwin.frame */
+.contacts-spinner.frame {
+ border-width: 0 1px 0 0;
+ border-style: solid;
+ border-color: @borders;
+ border-image: none;
+ border-radius: 0;
+ padding: 0;
+}
+
+/* Background color in contacts pane, similar to .documents-main-view.view */
+.contacts-main-view.view {
+ background-color: #f1f2f1;
+}
+
+.contacts-suggestion {
+ background-color: #D3D7CF;
+ border-radius: 4px;
+}
+
+/* Border on the right in the left menu toolbar */
+.contacts-left-header-bar:dir(ltr) {
+ border-right-width: 1px;
+}
+
+.contacts-left-header-bar:dir(rtl) {
+ border-left-width: 1px;
+}
+
+.contacts-left-header-bar:dir(ltr),
+.contacts-right-header-bar:dir(rtl) {
+ border-top-right-radius: 0;
+}
+
+.contacts-right-header-bar:dir(ltr),
+.contacts-left-header-bar:dir(rtl) {
+ border-top-left-radius: 0;
+}
+
+.contacts-avatar-frame.frame {
+ border-width: 1px 1px 0 1px;
+ border-style: solid;
+ border-color: @borders;
+ border-image: none;
+ border-radius: 0;
+ padding: 0;
+}
+
+.main-avatar-frame.frame {
+ border-width: 1px;
+ border-style: solid;
+ border-color: @borders;
+ border-radius: 6px;
+}
+
+/* Primary toolbar with no line at top to avoid conflicts with frame border */
+ContactsWindow .primary-toolbar.toolbar {
+ border-width: 0 0 1px 0;
+}
+
+.contacts-button:active {
+ border-color: #000000;
+ border-image: none;
+}
+
+.contacts-entry {
+ box-shadow: none;
+ border-image: none;
+ border-width: 1px;
+ border-radius: 4px;
+ border-style: solid;
+ border-color: #bbbeb7;
+ background-image: none;
+ background-color: #ffffff;
+}
+
+.contacts-entry:selected,
+.contacts-entry:selected:focus {
+ background-color: @theme_selected_bg_color;
+ color: @theme_selected_fg_color;
+}
+
+.contacts-entry.contacts-postal-entry {
+ border-radius: 0 0 0 0;
+ border-width: 1px 1px 0 1px;
+}
+
+.contacts-entry.contacts-postal-entry:nth-child(first) {
+ border-radius: 4px 4px 0 0;
+}
+
+.contacts-entry.contacts-postal-entry:nth-child(last) {
+ border-radius: 0 0 4px 4px;
+ border-width: 1px;
+}
+
+.button.contacts-square {
+ padding: 0px;
+}
+
+.contacts-combo .button {
+ border-image: none;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #bbbeb7;
+ background-image: none;
+ background-color: #ffffff;
+}
+
+.toolbar.contacts-edit-toolbar {
+ padding: 6px;
+ background-color: #E2E4E2;
+ border-width: 1px 0 0 0;
+ border-style: solid;
+ border-color: @borders;
+ border-image: none;
+}
+
+.toolbar.contacts-edit-toolbar .button {
+ padding-left: 6px;
+ padding-right: 6px;
+}
+
+.toolbar.contacts-selection-toolbar {
+ border-width: 1px 0 0 0;
+ border-style: solid;
+ border-color: @borders;
+ border-image: none;
+}
+
+.contacts-watermark {
+ color: #bebebe;
+ text-shadow: 1px 1px alpha(white, 0.6);
+}
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index ac306ee..71a82d8 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -246,6 +246,12 @@ public class Contacts.App : Gtk.Application {
ensure_eds_accounts ();
contacts_store = new Store ();
base.startup ();
+
+ var css_provider = load_css ("style.css");
+ Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default(),
+ css_provider,
+ Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
+
}
public override void activate () {
diff --git a/src/contacts-utils.vala b/src/contacts-utils.vala
index 755a8b1..1e5eef8 100644
--- a/src/contacts-utils.vala
+++ b/src/contacts-utils.vala
@@ -36,6 +36,17 @@ namespace Contacts {
return builder;
}
+ public Gtk.CssProvider load_css (string css) {
+ var provider = new Gtk.CssProvider ();
+ try {
+ var file = File.new_for_uri("resource:///org/gnome/contacts/ui/" + css);
+ provider.load_from_file (file);
+ } catch (GLib.Error e) {
+ warning ("loading css: %s", e.message);
+ }
+ return provider;
+ }
+
public void add_separator (ListBoxRow row,
ListBoxRow? before_row) {
row.set_header (new Separator (Orientation.HORIZONTAL));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]