aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/indicator-desktop-shortcuts.c1
-rw-r--r--src/indicator-ng.c13
3 files changed, 9 insertions, 7 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 400f91a..b638165 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -142,6 +142,6 @@ target_include_directories("${ayatana_indicator_gtkver}" PUBLIC ${CMAKE_CURRENT_
if(NOT APPLE)
target_link_options("${ayatana_indicator_gtkver}" PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/indicator.symbols")
endif()
-target_link_libraries("${ayatana_indicator_gtkver}" ${PROJECT_DEPS_LIBRARIES} ${EXTRA_LIBS})
+target_link_libraries("${ayatana_indicator_gtkver}" ${PROJECT_DEPS_LINK_LIBRARIES} ${EXTRA_LIBS})
add_dependencies("${ayatana_indicator_gtkver}" "src-generated")
install(TARGETS "${ayatana_indicator_gtkver}" LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}")
diff --git a/src/indicator-desktop-shortcuts.c b/src/indicator-desktop-shortcuts.c
index be1d632..99a687a 100644
--- a/src/indicator-desktop-shortcuts.c
+++ b/src/indicator-desktop-shortcuts.c
@@ -25,7 +25,6 @@ License along with this library. If not, see
#include "config.h"
#endif
-#include <gio/gdesktopappinfo.h>
#include "indicator-desktop-shortcuts.h"
#define ACTIONS_KEY "Actions"
diff --git a/src/indicator-ng.c b/src/indicator-ng.c
index a94f57e..0c76df6 100644
--- a/src/indicator-ng.c
+++ b/src/indicator-ng.c
@@ -53,6 +53,7 @@ struct _IndicatorNg
gint64 last_service_restart;
GMenuModel *lMenuSections[MENU_SECTIONS];
+ GtkCssProvider *label_css_provider;
};
static void indicator_ng_initable_iface_init (GInitableIface *initable);
@@ -157,6 +158,7 @@ indicator_ng_dispose (GObject *object)
indicator_ng_free_actions_and_menu (self);
+ g_clear_object (&self->label_css_provider);
g_clear_object (&self->entry.label);
g_clear_object (&self->entry.image);
g_clear_object (&self->entry.menu);
@@ -561,13 +563,14 @@ static void indicator_ng_set_label(IndicatorNg *self, const gchar *label)
}
GtkWidget *pParent = gtk_widget_get_parent(GTK_WIDGET(self->entry.label));
- GtkCssProvider *pCssProvider = gtk_css_provider_new();
- GtkStyleContext *pStyleContext = gtk_widget_get_style_context(GTK_WIDGET(self->entry.label));
- gtk_style_context_add_provider(pStyleContext, GTK_STYLE_PROVIDER(pCssProvider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ if (self->label_css_provider == NULL) {
+ self->label_css_provider = gtk_css_provider_new();
+ GtkStyleContext *pStyleContext = gtk_widget_get_style_context(GTK_WIDGET(self->entry.label));
+ gtk_style_context_add_provider(pStyleContext, GTK_STYLE_PROVIDER(self->label_css_provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ }
gchar *sCss = g_strdup_printf("label{padding-left: %ipx;}", nPadding);
- gtk_css_provider_load_from_data(pCssProvider, sCss, -1, NULL);
+ gtk_css_provider_load_from_data(self->label_css_provider, sCss, -1, NULL);
g_free(sCss);
- g_object_unref(pCssProvider);
if (GTK_IS_BOX(pParent))
{
gtk_box_set_spacing(GTK_BOX(pParent), nSpacing);