summaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2012-01-09 17:02:17 -0500
committerChris Lumens <clumens@redhat.com>2012-01-09 17:02:17 -0500
commit65f3d2b564ad2d8a43a90cf637dbac1846d84a1a (patch)
treed60cdd20e934b74633829d34aca96b65819fd6b6 /widgets
parentf84ae3cb42a3c812d29c0677df21cd41096be3fa (diff)
downloadanaconda-65f3d2b564ad2d8a43a90cf637dbac1846d84a1a.tar.gz
anaconda-65f3d2b564ad2d8a43a90cf637dbac1846d84a1a.tar.xz
anaconda-65f3d2b564ad2d8a43a90cf637dbac1846d84a1a.zip
Add style info to DiskOverview so rounded corners on selection work.
This could go into an external CSS file instead, but then I have to worry about loading it, and packaging it, and what the proper location should be, and all that kind of stuff. I could just shove it into a variable and be done with it.
Diffstat (limited to 'widgets')
-rw-r--r--widgets/src/DiskOverview.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/widgets/src/DiskOverview.c b/widgets/src/DiskOverview.c
index 73d09ef2a..15d5a89b3 100644
--- a/widgets/src/DiskOverview.c
+++ b/widgets/src/DiskOverview.c
@@ -54,6 +54,12 @@ enum {
#define ICON_SIZE 125
+static gchar *style_data = "AnacondaDiskOverview:selected {\n"
+ " border-radius: 6;\n"
+ " border-style: solid;\n"
+ " border-width: 1;\n"
+ "}";
+
struct _AnacondaDiskOverviewPrivate {
GtkWidget *vbox;
GtkWidget *kind;
@@ -177,6 +183,7 @@ GtkWidget *anaconda_disk_overview_new() {
/* Initialize the widgets in a newly allocated DiskOverview. */
static void anaconda_disk_overview_init(AnacondaDiskOverview *widget) {
+ GtkCssProvider *provider;
char *markup;
widget->priv = G_TYPE_INSTANCE_GET_PRIVATE(widget,
@@ -223,6 +230,13 @@ static void anaconda_disk_overview_init(AnacondaDiskOverview *widget) {
/* We need to handle button-press-event in order to change the background color. */
g_signal_connect(widget, "button-press-event", G_CALLBACK(anaconda_disk_overview_clicked), NULL);
+
+ /* Finally, load some style information for this widget. */
+ provider = gtk_css_provider_new();
+ if (gtk_css_provider_load_from_data(provider, style_data, -1, NULL)) {
+ GtkStyleContext *context = gtk_widget_get_style_context(GTK_WIDGET(widget));
+ gtk_style_context_add_provider(context, GTK_STYLE_PROVIDER(provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ }
}
gboolean anaconda_disk_overview_clicked(AnacondaDiskOverview *widget, GdkEvent *event) {