Skip to content

grid: fix sticky=>'n' and sticky=>'s' positioning#139

Merged
dk merged 1 commit intodk:masterfrom
HaraldJoerg:grid_sticky
Feb 13, 2025
Merged

grid: fix sticky=>'n' and sticky=>'s' positioning#139
dk merged 1 commit intodk:masterfrom
HaraldJoerg:grid_sticky

Conversation

@HaraldJoerg
Copy link
Contributor

The sticky option for gridConfigure works opposite to what I expect for sticky => 'n' and sticky => 's'.
My example code (again derived from your grid example with small changes):

use 5.020;
use strict;
use warnings;
use Prima qw(Application Label);

my $w = Prima::MainWindow->new(
    backColor => cl::Gray,
);
$w->insert(
	[Label => name => 'north', backColor => cl::Red],
	[Widget => name => 'g', backColor => cl::Green],
	[Label => name => 'south', backColor => cl::Blue],
	[Widget => name => 'y', backColor => cl::Yellow],
);

$w->gridConfigure(north => row => 0, column => 0, sticky => 'n');
$w->gridConfigure(g => row => 0, column => 1,);
$w->gridConfigure(south => row => 1, column => 0, sticky => 's');
$w->gridConfigure(y => row => 1, column => 1);

run Prima;

This puts the "north" label at the bottom of its cell, and the "south" label at its top:
prima_sticky

The patch swaps the north and south alignments, now it looks how I would expect it:
prima_sticky_patched

@dk dk merged commit a826a80 into dk:master Feb 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants