[gnome-software] Use a regular button for the 'Website' button
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Use a regular button for the 'Website' button
- Date: Thu, 10 Oct 2013 09:55:28 +0000 (UTC)
commit 3d53c239be0be8ae0e024b32dc9c92b9370feb94
Author: Richard Hughes <richard hughsie com>
Date: Thu Oct 10 10:55:04 2013 +0100
Use a regular button for the 'Website' button
Also make it a little wider and the same size as the 'History' button.
src/gnome-software.ui | 9 ++++++++-
src/gs-shell-details.c | 26 ++++++++++++++++++++++++--
2 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index fa09a77..132090d 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -1147,8 +1147,9 @@
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
- <object class="GtkLinkButton" id="application_details_url">
+ <object class="GtkButton" id="button_details_website">
<property name="label" translatable="yes">_Website</property>
+ <property name="width_request">150</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -1588,4 +1589,10 @@
<widget name="scrolledwindow_update_details"/>
</widgets>
</object>
+ <object class="GtkSizeGroup" id="sizegroup_details_buttons">
+ <widgets>
+ <widget name="button_details_website"/>
+ <widget name="button_history"/>
+ </widgets>
+ </object>
</interface>
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 0f27e0d..87a6dcf 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -278,6 +278,25 @@ gs_shell_details_refresh_screenshots (GsShellDetails *shell_details)
}
/**
+ * gs_shell_details_website_cb:
+ **/
+static void
+gs_shell_details_website_cb (GtkWidget *widget, GsShellDetails *shell_details)
+{
+ GError *error = NULL;
+ GsShellDetailsPrivate *priv = shell_details->priv;
+ const gchar *url;
+ gboolean ret;
+
+ url = gs_app_get_url (priv->app);
+ ret = gtk_show_uri (NULL, url, GDK_CURRENT_TIME, &error);
+ if (!ret) {
+ g_warning ("spawn of '%s' failed", url);
+ g_error_free (error);
+ }
+}
+
+/**
* gs_shell_details_refresh_all:
**/
static void
@@ -332,9 +351,8 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
}
tmp = gs_app_get_url (priv->app);
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "application_details_url"));
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_details_website"));
if (tmp != NULL && tmp[0] != '\0') {
- gtk_link_button_set_uri (GTK_LINK_BUTTON (widget), tmp);
gtk_widget_set_visible (widget, TRUE);
} else {
gtk_widget_set_visible (widget, FALSE);
@@ -787,6 +805,10 @@ gs_shell_details_setup (GsShellDetails *shell_details,
g_signal_connect (widget, "clicked",
G_CALLBACK (gs_shell_details_app_history_button_cb),
shell_details);
+ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_details_website"));
+ g_signal_connect (widget, "clicked",
+ G_CALLBACK (gs_shell_details_website_cb),
+ shell_details);
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_history_close"));
g_signal_connect (widget, "clicked",
G_CALLBACK (gs_shell_details_button_close_cb),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]