[rhythmbox/wip/headerbar] Port to GdHeaderBar
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox/wip/headerbar] Port to GdHeaderBar
- Date: Mon, 15 Apr 2013 14:24:36 +0000 (UTC)
commit e7eea59c02269f0bcabc7e80ddb2e03383da553e
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Apr 15 14:46:07 2013 +0200
Port to GdHeaderBar
.gitmodules | 3 +
Makefile.am | 4 +-
autogen.sh | 41 ++++++++-----
configure.ac | 16 +++--
data/ui/main-toolbar.ui | 160 ++++++++++++++++++++++--------------------------
libgd | 1 +
macros/Makefile.am | 1 -
macros/acinclude.m4 | 0
macros/check.m4 | 133 ----------------------------------------
macros/gsettings.m4 | 83 -------------------------
shell/Makefile.am | 2 +
shell/rb-shell.c | 47 +++++---------
12 files changed, 135 insertions(+), 356 deletions(-)
---
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..303eb9b
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "libgd"]
+ path = libgd
+ url = ../libgd
diff --git a/Makefile.am b/Makefile.am
index 7be3970..4a3585d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,9 +1,9 @@
-AUTOMAKE_OPTIONS = 1.7
+ACLOCAL_AMFLAGS = -I m4 -I libgd ${ACLOCAL_FLAGS}
DISTCHECK_CONFIGURE_FLAGS = --disable-schemas-install --enable-gtk-doc --disable-scrollkeeper
distuninstallcheck_listfiles = find . -type f -print | grep -v '^\./var/scrollkeeper'
-SUBDIRS = macros lib metadata rhythmdb widgets sources podcast \
+SUBDIRS = libgd lib metadata rhythmdb widgets sources podcast \
backends shell bindings sample-plugins plugins remote data po help tests doc
INCLUDES = rhythmbox.h
diff --git a/autogen.sh b/autogen.sh
index 0447892..d7f4818 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,21 +1,34 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
+test -n "$srcdir" || srcdir=`dirname "$0"`
+test -n "$srcdir" || srcdir=.
-PKG_NAME="rhythmbox"
+olddir=`pwd`
+cd "$srcdir"
-(test -f $srcdir/configure.ac) || {
- echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
- echo " top-level $PKG_NAME directory"
- exit 1
-}
+INTLTOOLIZE=`which intltoolize`
+if test -z $INTLTOOLIZE; then
+ echo "*** No intltoolize found, please install the intltool package ***"
+ exit 1
+fi
-which gnome-autogen.sh || {
- echo "You need to install gnome-common"
- exit 1
-}
+AUTORECONF=`which autoreconf`
+if test -z $AUTORECONF; then
+ echo "*** No autoreconf found, please install it ***"
+ exit 1
+fi
+
+if test -z `which autopoint`; then
+ echo "*** No autopoint found, please install it ***"
+ exit 1
+fi
+
+git submodule update --init --recursive
+
+autopoint --force
+AUTOPOINT='intltoolize --automake --copy' autoreconf --force --install --verbose
+
+cd "$olddir"
+test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
-ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I macros"
-REQUIRED_AUTOMAKE_VERSION=1.7 USE_GNOME2_MACROS=1 . gnome-autogen.sh --enable-uninstalled-build "$@"
diff --git a/configure.ac b/configure.ac
index f33adb1..0ed62df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,11 +3,9 @@ AC_INIT([rhythmbox],
[2.99.1],
[https://bugzilla.gnome.org/enter_bug.cgi?product=rhythmbox])
AC_CONFIG_SRCDIR(rhythmbox.pc.in)
-AC_CONFIG_MACRO_DIR(macros)
+AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS(config.h)
-AM_INIT_AUTOMAKE([1.9 dist-xz no-dist-gzip])
-
-AC_SUBST(ACLOCAL_AMFLAGS, "-I macros")
+AM_INIT_AUTOMAKE([1.11 tar-ustar dist-xz no-dist-gzip -Wno-portability])
AM_MAINTAINER_MODE([enable])
GNOME_MAINTAINER_MODE_DEFINES
@@ -738,13 +736,21 @@ AC_SUBST(GRILO_CFLAGS)
AC_SUBST(GRILO_LIBS)
dnl ================================================================
+dnl libgd
+dnl ================================================================
+LIBGD_INIT([
+ header-bar
+ static
+])
+
+dnl ================================================================
dnl end-game
dnl ================================================================
AC_OUTPUT([
rhythmbox.pc
Makefile
-macros/Makefile
+libgd/Makefile
lib/Makefile
lib/libmediaplayerid/Makefile
metadata/Makefile
diff --git a/data/ui/main-toolbar.ui b/data/ui/main-toolbar.ui
index 5565884..f510c98 100644
--- a/data/ui/main-toolbar.ui
+++ b/data/ui/main-toolbar.ui
@@ -1,113 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
- <object class="GtkToolbar" id="main-toolbar">
+ <object class="GdHeaderBar" id="headerbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="toolbar_style">icons</property>
- <property name="icon_size">6</property>
<child>
- <object class="GtkToolButton" id="previous-button">
- <property name="use_action_appearance">False</property>
+ <object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Start playing the previous song</property>
- <property name="use_action_appearance">False</property>
- <property name="action_name">app.play-previous</property>
- <property name="label" translatable="yes">Previous</property>
- <property name="icon_name">media-skip-backward</property>
+ <property name="orientation">horizontal</property>
+ <style>
+ <class name="raised"/>
+ <class name="linked"/>
+ </style>
+ <child>
+ <object class="GdHeaderSimpleButton" id="previous-button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Start playing the previous song</property>
+ <property name="use_action_appearance">False</property>
+ <property name="action_name">app.play-previous</property>
+ <property name="label" translatable="yes">Previous</property>
+ <property name="symbolic_icon_name">media-skip-backward-symbolic</property>
+ </object>
+ </child>
+ <child>
+ <object class="GdHeaderSimpleButton" id="play-button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Pause playback</property>
+ <property name="use_action_appearance">False</property>
+ <property name="action_name">app.play</property>
+ <property name="label" translatable="yes">Play</property>
+ <property name="symbolic_icon_name">media-playback-start-symbolic</property>
+ </object>
+ </child>
+ <child>
+ <object class="GdHeaderSimpleButton" id="next-button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Start playing the next song</property>
+ <property name="use_action_appearance">False</property>
+ <property name="action_name">app.play-next</property>
+ <property name="label" translatable="yes">Next</property>
+ <property name="symbolic_icon_name">media-skip-forward-symbolic</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="pack_type">start</property>
</packing>
</child>
<child>
- <object class="GtkToolButton" id="play-button">
- <property name="use_action_appearance">False</property>
+ <object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Pause playback</property>
- <property name="use_action_appearance">False</property>
- <property name="action_name">app.play</property>
- <property name="label" translatable="yes">Play</property>
- <property name="icon_name">media-playback-start</property>
+ <property name="orientation">horizontal</property>
+ <style>
+ <class name="raised"/>
+ <class name="linked"/>
+ </style>
+ <child>
+ <object class="GdHeaderToggleButton" id="repeat-button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Play first song again after all songs are
played</property>
+ <property name="use_action_appearance">False</property>
+ <property name="action_name">app.play-repeat</property>
+ <property name="label" translatable="yes">Repeat</property>
+ <property name="symbolic_icon_name">media-playlist-repeat-symbolic</property>
+ </object>
+ </child>
+ <child>
+ <object class="GdHeaderToggleButton" id="shuffle-button">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Play songs in a random order</property>
+ <property name="use_action_appearance">False</property>
+ <property name="action_name">app.play-shuffle</property>
+ <property name="label" translatable="yes">Shuffle</property>
+ <property name="symbolic_icon_name">media-playlist-shuffle-symbolic</property>
+ </object>
+ </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="pack_type">start</property>
</packing>
</child>
<child>
- <object class="GtkToolButton" id="next-button">
- <property name="use_action_appearance">False</property>
+ <object class="GdHeaderMenuButton" id="gear-menubutton">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Start playing the next song</property>
- <property name="use_action_appearance">False</property>
- <property name="action_name">app.play-next</property>
- <property name="label" translatable="yes">Next</property>
- <property name="icon_name">media-skip-forward</property>
+ <property name="symbolic_icon_name">emblem-system-symbolic</property>
+ <property name="action_name">win.gear-menu</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkSeparatorToolItem" id="separator1">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToggleToolButton" id="repeat-button">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Play first song again after all songs are
played</property>
- <property name="use_action_appearance">False</property>
- <property name="action_name">app.play-repeat</property>
- <property name="label" translatable="yes">Repeat</property>
- <property name="icon_name">media-playlist-repeat</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToggleToolButton" id="shuffle-button">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Play songs in a random order</property>
- <property name="use_action_appearance">False</property>
- <property name="action_name">app.play-shuffle</property>
- <property name="label" translatable="yes">Shuffle</property>
- <property name="icon_name">media-playlist-shuffle</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkSeparatorToolItem" id="separator2">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="use_action_appearance">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="pack_type">end</property>
</packing>
</child>
</object>
diff --git a/libgd b/libgd
new file mode 160000
index 0000000..e6117cf
--- /dev/null
+++ b/libgd
@@ -0,0 +1 @@
+Subproject commit e6117cfbd66bd3727f75272a638a08423aedaf40
diff --git a/shell/Makefile.am b/shell/Makefile.am
index be308bc..97fffbc 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -38,6 +38,7 @@ INCLUDES = \
-I$(top_builddir)/lib \
-I$(top_srcdir)/plugins \
-I$(top_srcdir)/backends \
+ -I$(top_srcdir)/libgd \
-DPIXMAP_DIR=\""$(datadir)/pixmaps"\" \
-DSHARE_DIR=\"$(pkgdatadir)\" \
-DDATADIR=\""$(datadir)"\" \
@@ -109,6 +110,7 @@ librhythmbox_core_la_LIBADD = \
$(top_builddir)/backends/librbbackends.la \
$(top_builddir)/lib/librb.la \
$(top_builddir)/lib/libmediaplayerid/libmediaplayerid.la \
+ $(top_builddir)/libgd/libgd.la \
$(DBUS_LIBS) \
$(TOTEM_PLPARSER_LIBS) \
$(GUDEV_LIBS) \
diff --git a/shell/rb-shell.c b/shell/rb-shell.c
index f8dc31a..b635fae 100644
--- a/shell/rb-shell.c
+++ b/shell/rb-shell.c
@@ -49,6 +49,8 @@
#include <gtk/gtk.h>
#include <girepository.h>
+#include <libgd/gd.h>
+
#include <libpeas/peas.h>
#include <libpeas-gtk/peas-gtk.h>
@@ -682,18 +684,15 @@ construct_load_ui (RBShell *shell)
{
GApplication *app = g_application_get_default ();
gboolean shell_shows_app_menu;
- GtkWidget *toolbar;
+ GdHeaderBar *headerbar;
GtkBuilder *builder;
- GtkToolItem *tool_item;
- GtkWidget *menu_button;
- GtkWidget *image;
GMenuModel *model;
rb_debug ("shell: loading ui");
rb_profile_start ("loading ui");
builder = rb_builder_load ("main-toolbar.ui", NULL);
- toolbar = GTK_WIDGET (gtk_builder_get_object (builder, "main-toolbar"));
+ headerbar = GD_HEADER_BAR (gtk_builder_get_object (builder, "headerbar"));
shell->priv->play_button = GTK_WIDGET (gtk_builder_get_object (builder, "play-button"));
@@ -703,32 +702,23 @@ construct_load_ui (RBShell *shell)
gtk_actionable_set_action_target_value (GTK_ACTIONABLE (gtk_builder_get_object (builder,
"repeat-button")),
g_variant_new_boolean (TRUE));
- gtk_style_context_add_class (gtk_widget_get_style_context (toolbar),
- GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
- gtk_box_pack_start (GTK_BOX (shell->priv->main_vbox), toolbar, FALSE, FALSE, 0);
- gtk_box_reorder_child (GTK_BOX (shell->priv->main_vbox), toolbar, 1);
-
- g_object_unref (builder);
-
- tool_item = gtk_tool_item_new ();
- gtk_tool_item_set_expand (tool_item, TRUE);
- gtk_container_add (GTK_CONTAINER (tool_item), GTK_WIDGET (shell->priv->header));
- gtk_widget_show_all (GTK_WIDGET (tool_item));
- gtk_toolbar_insert (GTK_TOOLBAR (toolbar), tool_item, -1);
+ gtk_box_pack_start (GTK_BOX (shell->priv->main_vbox), GTK_WIDGET (headerbar), FALSE, FALSE, 0);
+ gtk_box_reorder_child (GTK_BOX (shell->priv->main_vbox), GTK_WIDGET (headerbar), 1);
+ gd_header_bar_set_custom_title (headerbar, GTK_WIDGET (shell->priv->header));
/* menu tool button, only shown if the shell doesn't show the app menu,
* or in party mode where the app menu is inaccessible.
*/
- menu_button = gtk_menu_button_new ();
+ shell->priv->menu_button = GTK_WIDGET (gtk_builder_get_object (builder, "gear-menubutton"));
model = rb_application_get_shared_menu (RB_APPLICATION (app), "app-menu");
- gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button), model);
+ gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (shell->priv->menu_button), model);
g_object_get (gtk_settings_get_default (),
"gtk-shell-shows-app-menu", &shell_shows_app_menu,
NULL);
if (shell_shows_app_menu == FALSE) {
- gtk_widget_add_accelerator (menu_button,
+ gtk_widget_add_accelerator (shell->priv->menu_button,
"activate",
shell->priv->accel_group,
GDK_KEY_F10,
@@ -737,14 +727,7 @@ construct_load_ui (RBShell *shell)
rb_application_set_menu_accelerators (shell->priv->application, model, TRUE);
}
- image = gtk_image_new_from_icon_name ("emblem-system-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR);
- gtk_container_add (GTK_CONTAINER (menu_button), image);
-
- shell->priv->menu_button = GTK_WIDGET (gtk_tool_item_new ());
- gtk_container_add (GTK_CONTAINER (shell->priv->menu_button), menu_button);
- gtk_widget_show_all (shell->priv->menu_button);
- gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (shell->priv->menu_button), -1);
-
+ g_object_unref (builder);
rb_profile_end ("loading ui");
}
@@ -2207,17 +2190,17 @@ rb_shell_playing_changed_cb (RBShellPlayer *player, gboolean playing, RBShell *s
if (playing) {
if (rb_source_can_pause (rb_shell_player_get_active_source (shell->priv->player_shell))) {
- icon_name = "media-playback-pause";
+ icon_name = "media-playback-pause-symbolic";
tooltip = _("Pause playback");
} else {
- icon_name = "media-playback-stop";
+ icon_name = "media-playback-stop-symbolic";
tooltip = _("Stop playback");
}
} else {
- icon_name = "media-playback-start";
+ icon_name = "media-playback-start-symbolic";
tooltip = _("Start playback");
}
- gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (shell->priv->play_button), icon_name);
+ gd_header_button_set_symbolic_icon_name (GD_HEADER_BUTTON (shell->priv->play_button), icon_name);
gtk_widget_set_tooltip_text (GTK_WIDGET (shell->priv->play_button), tooltip);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]