sizing: Ignore scaling factor for layout selection
This commit is contained in:
		@ -103,9 +103,10 @@ eek_gtk_keyboard_real_draw (GtkWidget *self,
 | 
			
		||||
    return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Units of pixel size
 | 
			
		||||
static enum squeek_arrangement_kind get_type(uint32_t width, uint32_t height) {
 | 
			
		||||
    (void)height;
 | 
			
		||||
    if (width < 540) {
 | 
			
		||||
    if (width < 1080) {
 | 
			
		||||
        return ARRANGEMENT_KIND_BASE;
 | 
			
		||||
    }
 | 
			
		||||
    return ARRANGEMENT_KIND_WIDE;
 | 
			
		||||
@ -117,11 +118,11 @@ eek_gtk_keyboard_real_size_allocate (GtkWidget     *self,
 | 
			
		||||
{
 | 
			
		||||
    EekGtkKeyboardPrivate *priv =
 | 
			
		||||
        eek_gtk_keyboard_get_instance_private (EEK_GTK_KEYBOARD (self));
 | 
			
		||||
 | 
			
		||||
    uint32_t scale = (uint32_t)gtk_widget_get_scale_factor(self);
 | 
			
		||||
    // check if the change would switch types
 | 
			
		||||
    enum squeek_arrangement_kind new_type = get_type(
 | 
			
		||||
                (uint32_t)(allocation->width - allocation->x),
 | 
			
		||||
                (uint32_t)(allocation->height - allocation->y));
 | 
			
		||||
                (uint32_t)(allocation->width - allocation->x) * scale,
 | 
			
		||||
                (uint32_t)(allocation->height - allocation->y) * scale);
 | 
			
		||||
    if (priv->layout->arrangement != new_type) {
 | 
			
		||||
        priv->layout->arrangement = new_type;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user