/*
* xfce4-hdaps, an XFCE4 panel plugin for the HDAPS system.
*
- * Copyright Michael Orlitzky
+ * Copyright (C) 2019 Michael Orlitzky
*
- * http://michael.orlitzky.com/
+ * http://michael.orlitzky.com/
*
* This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details:
+ *
+ * https://www.gnu.org/licenses/agpl-3.0.html
*
- * http://www.fsf.org/licensing/licenses/gpl.html
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#include "hdaps.h"
#include "xfce4-hdaps.h"
#include "xfce4-hdaps-dialogs.h"
static void hdaps_construct(XfcePanelPlugin *plugin);
/* Register the plugin with the panel. */
-XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(hdaps_construct);
+XFCE_PANEL_PLUGIN_REGISTER(hdaps_construct);
void hdaps_save(XfcePanelPlugin *plugin, HdapsPlugin *hdaps) {
hdaps->eventbox = gtk_event_box_new();
gtk_widget_show(hdaps->eventbox);
+ /* Make the event box transparent. In newer versions of xfce4-panel
+ users can make the panel transparent, so we don't want to stick a
+ big opaque box on it. */
+ gtk_event_box_set_visible_window(GTK_EVENT_BOX(hdaps->eventbox), FALSE);
+
/* Set up the hvbox for the widget, which supports
both horizontal and vertical (hv) orientations. */
hdaps->hvbox = xfce_hvbox_new(orientation, FALSE, 2);
gtk_widget_set_size_request(GTK_WIDGET(plugin), size, -1);
}
+ /* This fixes an issue where the initial icon size is too small. */
+ hdaps_set_icon(hdaps, hdaps->previous_status);
+
/* We handled the change, so we're supposed to return TRUE. */
return TRUE;
}