Scale's value is not vertically aligned when orientation is horizontal and marks are used
I believe that the "100.0" should be aligned with the trough, but it appears offset down - I think it's being aligned vertically with the "whole scale element", and the marks drag that vertical size down.
Here's how it looks like GTK 3:
Here's the example app:
#include <gtk/gtk.h>
static void activate(GApplication * app, G_GNUC_UNUSED gpointer * data) {
GtkAdjustment * adjustment = gtk_adjustment_new(100.0, 0.0, 100.0, 1.0, 10.0, 0.0);
GtkScale * scale = (GTK_SCALE(gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, adjustment)));
gtk_scale_set_value_pos(scale, GTK_POS_LEFT);
gtk_scale_set_draw_value(scale, 1);
gtk_scale_add_mark(scale, 50.0, GTK_POS_BOTTOM, NULL);
GtkWidget * win = gtk_application_window_new(GTK_APPLICATION(app));
gtk_window_set_title(GTK_WINDOW(win), "Test");
gtk_window_set_default_size(GTK_WINDOW(win), 200, 200);
gtk_window_set_child(GTK_WINDOW(win), GTK_WIDGET(scale));
gtk_window_present(GTK_WINDOW(win));
}
int main(int argc, char ** argv) {
GtkApplication * app = gtk_application_new("org.test", G_APPLICATION_FLAGS_NONE);
g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
return g_application_run(G_APPLICATION(app), argc, argv);
}
Compiled as follows: gcc gtk.c
pkg-config -cflags --libs gtk4This affected me with GTK 4.6.7 on both Windows (compiled with
gtk-build`) and Fedora 36.