Kaydet (Commit) fa5a00b4 authored tarafından Colomban Wendling's avatar Colomban Wendling

Map GeanyWrapLabel to GtkLabel on GTK3

The GTK3 version of GtkLabel provides what GeanyWrapLabel is for given
the appropriate settings are set, so no need to our own widget -- that
would require being updated to support GTK3 anyway.
üst 3e649ddd
......@@ -29,6 +29,7 @@
#include "utils.h"
#include "geanywraplabel.h"
#if ! GTK_CHECK_VERSION(3, 0, 0)
struct _GeanyWrapLabelClass
......@@ -154,3 +155,5 @@ GtkWidget *geany_wrap_label_new(const gchar *text)
{
return g_object_new(GEANY_WRAP_LABEL_TYPE, "label", text, NULL);
}
#endif
......@@ -25,6 +25,8 @@
G_BEGIN_DECLS
#if ! GTK_CHECK_VERSION(3, 0, 0)
#define GEANY_WRAP_LABEL_TYPE (geany_wrap_label_get_type())
#define GEANY_WRAP_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
GEANY_WRAP_LABEL_TYPE, GeanyWrapLabel))
......@@ -42,6 +44,29 @@ typedef struct _GeanyWrapLabelClass GeanyWrapLabelClass;
GType geany_wrap_label_get_type (void);
GtkWidget* geany_wrap_label_new (const gchar *text);
#else /* GTK 3.0 */
#define GEANY_WRAP_LABEL_TYPE GTK_TYPE_LABEL
#define GEANY_WRAP_LABEL GTK_LABEL
#define GEANY_WRAP_LABEL_CLASS GTK_LABEL_CLASS
#define IS_GEANY_WRAP_LABEL GTK_IS_LABEL
#define IS_GEANY_WRAP_LABEL_CLASS GTK_IS_LABEL_CLASS
#define GeanyWrapLabel GtkLabel
#define GeanyWrapLabelClass GtkLabelClass
#define geany_wrap_label_get_type gtk_label_get_type
#define geany_wrap_label_new(text) \
g_object_new(GTK_TYPE_LABEL, \
"label", (text), \
"wrap", TRUE, \
"wrap-mode", PANGO_WRAP_WORD_CHAR, \
"xalign", 0.0, \
"yalign", 0.0, \
NULL)
#endif
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment