[gnome-software] Various visual improvements
- From: Florian Brosch <flobrosch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Various visual improvements
- Date: Wed, 23 Jan 2013 13:52:35 +0000 (UTC)
commit 1531f457bd9624f6a279e179cb40aaf0e36aa7fa
Author: Florian Brosch <flo brosch gmail com>
Date: Wed Jan 23 14:34:45 2013 +0100
Various visual improvements
data/Makefile.am | 3 +-
data/gtk-style.css | 40 ++++
src/gnome-software.ui | 554 ++++++++++++++++++++++++++++---------------------
src/gs-main.c | 43 ++--
4 files changed, 381 insertions(+), 259 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index b171df1..4b12afe 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -2,7 +2,8 @@ resourcesdir = $(datadir)/gnome-software
dist_resources_DATA = \
featured-gimp.png \
featured-firefox.png \
- featured-xchat.png
+ featured-xchat.png \
+ gtk-style.css
MAINTAINERCLEANFILES = \
*~ \
diff --git a/data/gtk-style.css b/data/gtk-style.css
new file mode 100644
index 0000000..3c01968
--- /dev/null
+++ b/data/gtk-style.css
@@ -0,0 +1,40 @@
+
+
+GtkViewport {
+ background-color: transparent;
+}
+
+
+GtkEventBox.gradient_box_software {
+ /* TODO: Borders are broken for GtkEventBox
+ border-style: solid;
+ border-color: 204a87;
+ border-width: 5px 0px 5px 0px;
+ */
+
+ background-image:
+ -gtk-gradient (
+ linear,
+ left top,
+ left bottom,
+ from (#214b88),
+ to (#3465a4));
+}
+
+
+.toolbar-primary-buttons-software:active {
+ font-weight: bold;
+}
+
+.index-title-alignment-software > GtkLabel {
+ font-weight: bold;
+ color: #555753;
+ font-size: 14;
+}
+
+
+GtkNotebook.main-notebook-software > GtkScrolledWindow {
+ border-bottom-width: 0px;
+ border-left-width: 0px;
+ border-right-width: 0px;
+}
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index 38546f4..0fdbd4a 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -15,126 +15,139 @@
<property name="can_focus">False</property>
<property name="title" translatable="yes">Software</property>
<property name="hide_titlebar_when_maximized">True</property>
- <property name="type_hint">dialog</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="border_width">9</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
- <object class="GtkBox" id="box2">
+ <object class="GtkToolbar" id="toolbar1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">21</property>
+ <property name="show_arrow">False</property>
<child>
- <object class="GtkLabel" id="label_update_all">
+ <object class="GtkToolItem" id="toolitem1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButtonBox" id="buttonbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="layout_style">center</property>
- <style>
- <class name="linked"/>
- </style>
<child>
- <object class="GtkButton" id="button_new">
- <property name="use_action_appearance">False</property>
+ <object class="GtkBox" id="box2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">21</property>
<child>
- <object class="GtkLabel" id="label_button_new">
+ <object class="GtkLabel" id="label_update_all">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">New</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
</child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button_installed">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
<child>
- <object class="GtkLabel" id="label_button_installed">
+ <object class="GtkButtonBox" id="buttonbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Installed</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
+ <property name="layout_style">center</property>
+ <style>
+ <class name="linked"/>
+ </style>
+ <child>
+ <object class="GtkButton" id="button_new">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <style>
+ <class name="toolbar-primary-buttons-software"/>
+ </style>
+ <child>
+ <object class="GtkLabel" id="label_button_new">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">New</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_installed">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <style>
+ <class name="toolbar-primary-buttons-software"/>
+ </style>
+ <child>
+ <object class="GtkLabel" id="label_button_installed">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Installed</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_updates">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <style>
+ <class name="toolbar-primary-buttons-software"/>
+ </style>
+ <child>
+ <object class="GtkLabel" id="label_button_updates">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Updates</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button_updates">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
<child>
- <object class="GtkLabel" id="label_button_updates">
+ <object class="GtkButton" id="button_update_all">
+ <property name="label" translatable="yes">Update All</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Updates</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <style>
+ <class name="suggested-action"/>
+ </style>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
</child>
</object>
<packing>
<property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button_update_all">
- <property name="label" translatable="yes">Update All</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
</packing>
</child>
</object>
@@ -171,141 +184,187 @@
<property name="can_focus">True</property>
<property name="show_border">False</property>
<child>
- <object class="GtkBox" id="box3">
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Featured</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- <attribute name="scale" value="1.5"/>
- <attribute name="foreground" value="#874887488748"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">9</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <style>
+ <class name="main-scrolled-software"/>
+ </style>
<child>
- <object class="GtkBox" id="box4">
+ <object class="GtkViewport" id="viewport1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">center</property>
<child>
- <object class="GtkImage" id="image_featured1">
+ <object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="stock">gtk-delete</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">20</property>
+ <style>
+ <class name="index-title-alignment-software"/>
+ </style>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Featured</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">9</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEventBox" id="gradient_box_software">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <style>
+ <class name="gradient_box_software"/>
+ </style>
+ <child>
+ <object class="GtkBox" id="box4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkImage" id="image_featured1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="ypad">5</property>
+ <property name="stock">gtk-delete</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="image_featured2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="ypad">5</property>
+ <property name="stock">gtk-delete</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="image_featured3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="ypad">5</property>
+ <property name="stock">gtk-delete</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">10</property>
+ <property name="left_padding">20</property>
+ <style>
+ <class name="index-title-alignment-software"/>
+ </style>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Popular</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">9</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkIconView" id="iconview_popular">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscroll_policy">natural</property>
+ <property name="vscroll_policy">natural</property>
+ <property name="selection_mode">none</property>
+ <property name="model">liststore_popular</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">10</property>
+ <property name="left_padding">20</property>
+ <style>
+ <class name="index-title-alignment-software"/>
+ </style>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Categories</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">9</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Social Networking</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image_featured2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-delete</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image_featured3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-delete</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Popular</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- <attribute name="scale" value="1.5"/>
- <attribute name="foreground" value="#874887488748"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">9</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkIconView" id="iconview_popular">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscroll_policy">natural</property>
- <property name="vscroll_policy">natural</property>
- <property name="selection_mode">none</property>
- <property name="model">liststore_popular</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Categories</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- <attribute name="scale" value="1.5"/>
- <attribute name="foreground" value="#874887488748"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">9</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label">Social Networking</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">5</property>
- </packing>
</child>
</object>
</child>
@@ -325,6 +384,9 @@
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="shadow_type">in</property>
+ <style>
+ <class name="main-scrolled-software"/>
+ </style>
<child>
<placeholder/>
</child>
@@ -350,6 +412,9 @@
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="shadow_type">in</property>
+ <style>
+ <class name="main-scrolled-software"/>
+ </style>
<child>
<placeholder/>
</child>
@@ -370,35 +435,48 @@
</packing>
</child>
<child>
- <object class="GtkBox" id="box_waiting">
+ <object class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_top">48</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkSpinner" id="spinner_waiting">
- <property name="width_request">48</property>
- <property name="height_request">48</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
<child>
- <object class="GtkLabel" id="label_waiting">
+ <object class="GtkViewport" id="viewport2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label">Waiting for something</property>
+ <child>
+ <object class="GtkBox" id="box_waiting">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">48</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkSpinner" id="spinner_waiting">
+ <property name="width_request">48</property>
+ <property name="height_request">48</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label_waiting">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Waiting for something</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
<packing>
@@ -426,7 +504,9 @@
</object>
</child>
</object>
- <object class="GtkSizeGroup" id="sizegroup_header_center">
+ <object class="GtkSizeGroup" id="sizegroup_header_center"/>
+ <object class="GtkSizeGroup" id="sizegroup_header_edges">
+ <property name="mode">both</property>
<widgets>
<widget name="label_update_all"/>
<widget name="button_update_all"/>
diff --git a/src/gs-main.c b/src/gs-main.c
index 52138e8..68a5d5e 100644
--- a/src/gs-main.c
+++ b/src/gs-main.c
@@ -29,6 +29,7 @@
#include "egg-list-box.h"
#include "gs-app-widget.h"
+#define CSS_FILE DATADIR "/gnome-software/gtk-style.css"
#define GS_MAIN_ICON_SIZE 64
typedef enum {
@@ -67,6 +68,7 @@ typedef struct {
EggListBox *list_box_installed;
EggListBox *list_box_updates;
GtkWidget *os_update_widget;
+ GtkCssProvider *provider;
} GsMainPrivate;
static void gs_main_set_overview_mode_ui (GsMainPrivate *priv, GsMainMode mode);
@@ -917,20 +919,6 @@ gs_main_get_popular (GsMainPrivate *priv)
(GAsyncReadyCallback) gs_main_get_packages_cb, priv);
}
-/**
- * gs_main_label_set_dim:
- **/
-static void
-gs_main_label_set_dim (GtkWidget *widget, gboolean use_dim_label)
-{
- GtkStyleContext *context;
- context = gtk_widget_get_style_context (widget);
- if (use_dim_label) {
- gtk_style_context_add_class (context, "dim-label");
- } else {
- gtk_style_context_remove_class (context, "dim-label");
- }
-}
/**
* gs_main_set_overview_mode_ui:
@@ -987,13 +975,6 @@ gs_main_set_overview_mode_ui (GsMainPrivate *priv, GsMainMode mode)
g_assert_not_reached ();
}
- /* fix sensitivities */
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "label_button_new"));
- gs_main_label_set_dim (widget, mode != GS_MAIN_MODE_NEW);
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "label_button_updates"));
- gs_main_label_set_dim (widget, mode != GS_MAIN_MODE_UPDATES);
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "label_button_installed"));
- gs_main_label_set_dim (widget, mode != GS_MAIN_MODE_INSTALLED);
/* set panel */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "notebook_main"));
@@ -1178,6 +1159,24 @@ gs_main_startup_cb (GApplication *application, GsMainPrivate *priv)
GtkWidget *main_window;
GtkWidget *widget;
+ /* get CSS */
+ if (priv->provider == NULL) {
+ priv->provider = gtk_css_provider_new ();
+
+
+ gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
+ GTK_STYLE_PROVIDER (priv->provider),
+ G_MAXUINT);
+
+ gtk_css_provider_load_from_path (priv->provider, CSS_FILE, &error);
+ if (error != NULL) {
+ g_warning ("Error loading stylesheet from file %s. %s", CSS_FILE, error->message);
+ g_error_free (error);
+ error = NULL;
+ }
+ }
+
+
/* get UI */
priv->builder = gtk_builder_new ();
retval = gtk_builder_add_from_resource (priv->builder,
@@ -1351,6 +1350,8 @@ out:
g_object_unref (priv->desktop);
g_object_unref (priv->cancellable);
g_object_unref (priv->application);
+ if (priv->provider != NULL)
+ g_object_unref (priv->provider);
if (priv->builder != NULL)
g_object_unref (priv->builder);
if (priv->waiting_tab_id > 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]