summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-11-05 13:43:43 (EST)
committer Patrick McDermott <pj@pehjota.net>2017-11-05 13:43:43 (EST)
commitd162678bac0161195bc86ccb03792248a7d1eba6 (patch)
treed7938c6323787307aa2218f4259100e693a31f0d /src
parent35e1207e20599e6fec04bd13556503e5eb7794dc (diff)
downloadmarquee-d162678bac0161195bc86ccb03792248a7d1eba6.zip
marquee-d162678bac0161195bc86ccb03792248a7d1eba6.tar.gz
marquee-d162678bac0161195bc86ccb03792248a7d1eba6.tar.bz2
MqMainMenu: Get current profile name and color from MqProfiles
Diffstat (limited to 'src')
-rw-r--r--src/toolbars/navigation/main-menu.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/toolbars/navigation/main-menu.c b/src/toolbars/navigation/main-menu.c
index 6d875ad..a9f5cd3 100644
--- a/src/toolbars/navigation/main-menu.c
+++ b/src/toolbars/navigation/main-menu.c
@@ -25,6 +25,8 @@
#include <gtk/gtk.h>
#include <webkit2/webkit2.h>
+#include "../../application.h"
+#include "../../config/profiles.h"
#include "../../notebook.h"
#include "../../tab-page.h"
#include "../../utils/profile-icon.h"
@@ -360,15 +362,29 @@ create_main_grid(MqMainMenu *main_menu)
static GtkWidget *
create_profile_buttons(MqMainMenu *main_menu)
{
- GtkWidget *profile_button;
- GtkWidget *preferences_button;
- GtkWidget *grid;
-
- /* ID, ICON, LABEL, TOOLTIP */
- NEW_BUTTON(profile, NULL, "Default", "Manage profiles");
+ MqProfiles *profiles;
+ gchar *cur_prof;
+ gchar *cur_prof_name;
+ gchar *cur_prof_color;
+ GtkWidget *profile_button;
+ GtkWidget *preferences_button;
+ GtkWidget *grid;
+
+ profiles = mq_application_get_profiles(
+ mq_tab_page_get_application(main_menu->tab_page));
+ cur_prof = mq_profiles_get_current(profiles);
+ cur_prof_name = mq_profiles_get_name(profiles, cur_prof);
+ cur_prof_color = mq_profiles_get_color(profiles, cur_prof);
+
+ /* ID, ICON, LABEL, TOOLTIP */
+ NEW_BUTTON(profile, NULL, cur_prof_name, "Manage profiles");
gtk_button_set_image(GTK_BUTTON(profile_button),
gtk_image_new_from_pixbuf(
- mq_profile_icon_new_pixbuf("#0000ff")));
+ mq_profile_icon_new_pixbuf(cur_prof_color)));
+
+ g_free(cur_prof);
+ g_free(cur_prof_name);
+ g_free(cur_prof_color);
/* ID, ICON, LABEL, TOOLTIP */
NEW_BUTTON(preferences, "preferences-desktop", NULL, "Preferences");