summaryrefslogtreecommitdiff
path: root/stickynotes
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-12-13 23:18:26 +0100
committerVictor Kareh <[email protected]>2022-03-22 16:25:09 -0400
commitb3892cf644c693fef44b5daf55a0b66a667ac147 (patch)
tree4d1acd062b9b7adc49239036cfe156444c88374c /stickynotes
parent0685093d85f70823d71397e35f3c2acf09a0c083 (diff)
downloadmate-applets-b3892cf644c693fef44b5daf55a0b66a667ac147.tar.bz2
mate-applets-b3892cf644c693fef44b5daf55a0b66a667ac147.tar.xz
Fix some -Wfloat-conversion warnings
Diffstat (limited to 'stickynotes')
-rw-r--r--stickynotes/stickynotes_applet.c5
-rw-r--r--stickynotes/stickynotes_applet_callbacks.c32
-rw-r--r--stickynotes/stickynotes_callbacks.c12
3 files changed, 31 insertions, 18 deletions
diff --git a/stickynotes/stickynotes_applet.c b/stickynotes/stickynotes_applet.c
index c697151e..fd903e1e 100644
--- a/stickynotes/stickynotes_applet.c
+++ b/stickynotes/stickynotes_applet.c
@@ -166,6 +166,7 @@ stickynotes_applet_init (MatePanelApplet *mate_panel_applet)
{
cairo_t *cr;
gint size, scale;
+ int screen_height;
stickynotes = g_new (StickyNotes, 1);
@@ -208,8 +209,8 @@ stickynotes_applet_init (MatePanelApplet *mate_panel_applet)
G_CALLBACK (preferences_apply_cb), NULL);
/* Max height for large notes*/
- stickynotes->max_height =
- 0.8 * HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ()));
+ screen_height = HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ()));
+ stickynotes->max_height = (int) (0.8 * (double) screen_height);
/* Load sticky notes */
stickynotes_load (gtk_widget_get_screen (GTK_WIDGET (mate_panel_applet)));
diff --git a/stickynotes/stickynotes_applet_callbacks.c b/stickynotes/stickynotes_applet_callbacks.c
index c0889df2..6481bb82 100644
--- a/stickynotes/stickynotes_applet_callbacks.c
+++ b/stickynotes/stickynotes_applet_callbacks.c
@@ -444,18 +444,26 @@ menu_about_cb (GtkAction *action,
void
preferences_save_cb (gpointer data)
{
- gint width = gtk_adjustment_get_value (stickynotes->w_prefs_width);
- gint height = gtk_adjustment_get_value (stickynotes->w_prefs_height);
- gboolean sys_color =
- gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (stickynotes->w_prefs_sys_color));
- gboolean sys_font =
- gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (stickynotes->w_prefs_sys_font));
- gboolean sticky =
- gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (stickynotes->w_prefs_sticky));
- gboolean force_default =
- gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (stickynotes->w_prefs_force));
- gboolean desktop_hide =
- gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (stickynotes->w_prefs_desktop));
+ gint width;
+ gint height;
+ gboolean sys_color;
+ gboolean sys_font;
+ gboolean sticky;
+ gboolean force_default;
+ gboolean desktop_hide;
+ gdouble adjustment_value;
+
+ adjustment_value = gtk_adjustment_get_value (stickynotes->w_prefs_width);
+ width = (gint) adjustment_value;
+
+ adjustment_value = gtk_adjustment_get_value (stickynotes->w_prefs_height);
+ height = (gint) adjustment_value;
+
+ sys_color = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (stickynotes->w_prefs_sys_color));
+ sys_font = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (stickynotes->w_prefs_sys_font));
+ sticky = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (stickynotes->w_prefs_sticky));
+ force_default = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (stickynotes->w_prefs_force));
+ desktop_hide = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (stickynotes->w_prefs_desktop));
if (g_settings_is_writable (stickynotes->settings,
"default-width"))
diff --git a/stickynotes/stickynotes_callbacks.c b/stickynotes/stickynotes_callbacks.c
index dac681a1..3f22dab7 100644
--- a/stickynotes/stickynotes_callbacks.c
+++ b/stickynotes/stickynotes_callbacks.c
@@ -49,13 +49,17 @@ gboolean stickynote_resize_cb (GtkWidget *widget,
if (widget == note->w_resize_se)
gtk_window_begin_resize_drag (GTK_WINDOW (note->w_window),
GDK_WINDOW_EDGE_SOUTH_EAST,
- event->button, event->x_root,
- event->y_root, event->time);
+ event->button,
+ (gint) event->x_root,
+ (gint) event->y_root,
+ event->time);
else /* if (widget == note->w_resize_sw) */
gtk_window_begin_resize_drag (GTK_WINDOW (note->w_window),
GDK_WINDOW_EDGE_SOUTH_WEST,
- event->button, event->x_root,
- event->y_root, event->time);
+ event->button,
+ (gint) event->x_root,
+ (gint) event->y_root,
+ event->time);
}
else
return FALSE;