Skip to content
Snippets Groups Projects
Commit d02b2af7 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #11491: gnome: fix gtk2 build

parent a5e13bb1
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,14 @@ GtkWidget *gtk_box_new(GtkOrientation orientation, gint spacing)
return gtk_vbox_new(FALSE, spacing);
}
GtkWidget *gtk_scale_new(GtkOrientation orientation, GtkAdjustment *adjustment)
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
return gtk_hscale_new(adjustment);
else
return gtk_vscale_new(adjustment);
}
GtkWidget* gtk_button_box_new(GtkOrientation orientation)
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
......
......@@ -51,6 +51,8 @@ GtkWidget *
gtk_scale_new_with_range(GtkOrientation orientation, gdouble min, gdouble max,
gdouble step);
GtkWidget *
gtk_scale_new(GtkOrientation orientation, GtkAdjustment *adjustment);
#endif
#endif // BOX_H_
......@@ -26,14 +26,17 @@
*
*/
// #include <config.h>
#include <gtk/gtk.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gtk/gtk.h>
#include "gtk2_wrappers.h"
#include "seekslider.h"
#include "dbus.h"
#include "logger.h"
#include "config.h"
/**
* SECTION:sfl-seekslider
......@@ -106,15 +109,13 @@ sfl_seekslider_init (SFLSeekSlider *seekslider)
gdouble pageincrement = SEEKSLIDER_PAGEINCREMENT;
gdouble pagesize = SEEKSLIDER_PAGESIZE;
GtkAdjustment *adjustment = gtk_adjustment_new(init_value, min_value, max_value, stepincrement, pageincrement, pagesize);
if(adjustment == NULL) {
GtkAdjustment *adjustment = GTK_ADJUSTMENT(gtk_adjustment_new(init_value, min_value, max_value, stepincrement, pageincrement, pagesize));
if (adjustment == NULL)
WARN("Invalid adjustment value for horizontal scale");
}
seekslider->priv->hscale = gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, adjustment);
if(seekslider->priv->hscale == NULL) {
if (seekslider->priv->hscale == NULL)
WARN("Could not create new horizontal scale");
}
g_signal_connect(G_OBJECT(seekslider->priv->hscale), "change-value",
G_CALLBACK(on_playback_scale_value_changed_cb), seekslider);
......@@ -250,6 +251,6 @@ void sfl_seekslider_update_scale(SFLSeekSlider *seekslider, guint current, guint
gdouble val = ((gdouble) current / (gdouble) size) * 100.0;
if(seekslider->priv->can_update_scale == TRUE) {
gtk_range_set_value(GTK_RANGE(seekslider->priv->hscale), val); }
if (seekslider->priv->can_update_scale)
gtk_range_set_value(GTK_RANGE(seekslider->priv->hscale), val);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment