1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-06 05:52:48 -05:00

Break up gtkmisc.c.

It's another file that should have been subdivided into lots of tiny
separate things in the utils library - especially since for some
reason I made a completely separate 'guimisc' cmake-level library for
it when there was no need.
This commit is contained in:
Simon Tatham
2021-04-24 07:51:15 +01:00
parent 7f3a3a21eb
commit d9f217323e
7 changed files with 145 additions and 102 deletions

View File

@ -0,0 +1,20 @@
/*
* Helper function to align the text in a GtkLabel to the left, which
* has to be done in several different ways depending on GTK version.
*/
#include <gtk/gtk.h>
#include "putty.h"
#include "gtkcompat.h"
#include "gtkmisc.h"
void align_label_left(GtkLabel *label)
{
#if GTK_CHECK_VERSION(3,16,0)
gtk_label_set_xalign(label, 0.0);
#elif GTK_CHECK_VERSION(3,14,0)
gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START);
#else
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
#endif
}