mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 11:39:13 +02:00
gtk: don't allow image and label to be drawn outside button (issue #0011120)
git-svn-id: trunk@19646 -
This commit is contained in:
parent
83b4f6f197
commit
de39b16ffd
@ -142,7 +142,6 @@ begin
|
|||||||
WidgetInfo^.UserData := BitBtnInfo;
|
WidgetInfo^.UserData := BitBtnInfo;
|
||||||
WidgetInfo^.DataOwner := True;
|
WidgetInfo^.DataOwner := True;
|
||||||
|
|
||||||
|
|
||||||
BitBtnInfo^.AlignWidget := gtk_alignment_new(0.5, 0.5, 0, 0);
|
BitBtnInfo^.AlignWidget := gtk_alignment_new(0.5, 0.5, 0, 0);
|
||||||
gtk_container_add(Pointer(Result), BitBtnInfo^.AlignWidget);
|
gtk_container_add(Pointer(Result), BitBtnInfo^.AlignWidget);
|
||||||
|
|
||||||
@ -151,7 +150,7 @@ begin
|
|||||||
|
|
||||||
BitBtnInfo^.LabelWidget := gtk_label_new('bitbtn');
|
BitBtnInfo^.LabelWidget := gtk_label_new('bitbtn');
|
||||||
gtk_table_attach(BitBtnInfo^.TableWidget, BitBtnInfo^.LabelWidget,
|
gtk_table_attach(BitBtnInfo^.TableWidget, BitBtnInfo^.LabelWidget,
|
||||||
2, 3, 0, 4, 0, 0, 0, 0);
|
2, 3, 0, 4, GTK_SHRINK or GTK_FILL, GTK_SHRINK or GTK_FILL, 0, 0);
|
||||||
|
|
||||||
BitBtnInfo^.SpaceWidget := nil;
|
BitBtnInfo^.SpaceWidget := nil;
|
||||||
BitBtnInfo^.ImageWidget := nil;
|
BitBtnInfo^.ImageWidget := nil;
|
||||||
@ -359,36 +358,36 @@ begin
|
|||||||
blGlyphLeft: begin
|
blGlyphLeft: begin
|
||||||
if AInfo^.ImageWidget <> nil
|
if AInfo^.ImageWidget <> nil
|
||||||
then gtk_table_attach(AInfo^.TableWidget, AInfo^.ImageWidget,
|
then gtk_table_attach(AInfo^.TableWidget, AInfo^.ImageWidget,
|
||||||
1, 2, 1, 3, 0, 0, 0, 0);
|
1, 2, 1, 3, GTK_SHRINK or GTK_FILL, GTK_SHRINK or GTK_FILL, 0, 0);
|
||||||
gtk_table_attach(AInfo^.TableWidget, AInfo^.LabelWidget,
|
gtk_table_attach(AInfo^.TableWidget, AInfo^.LabelWidget,
|
||||||
2, 3, 1, 3, 0, 0, 0, 0);
|
2, 3, 1, 3, GTK_SHRINK or GTK_FILL, GTK_SHRINK or GTK_FILL, 0, 0);
|
||||||
end;
|
end;
|
||||||
blGlyphRight: begin
|
blGlyphRight: begin
|
||||||
gtk_table_attach(AInfo^.TableWidget, AInfo^.LabelWidget,
|
gtk_table_attach(AInfo^.TableWidget, AInfo^.LabelWidget,
|
||||||
1, 2, 1, 3, 0, 0, 0, 0);
|
1, 2, 1, 3, GTK_SHRINK or GTK_FILL, GTK_SHRINK or GTK_FILL, 0, 0);
|
||||||
if AInfo^.ImageWidget <> nil
|
if AInfo^.ImageWidget <> nil
|
||||||
then gtk_table_attach(AInfo^.TableWidget, AInfo^.ImageWidget,
|
then gtk_table_attach(AInfo^.TableWidget, AInfo^.ImageWidget,
|
||||||
2, 3, 1, 3, 0, 0, 0, 0);
|
2, 3, 1, 3, GTK_SHRINK or GTK_FILL, GTK_SHRINK or GTK_FILL, 0, 0);
|
||||||
if AInfo^.SpaceWidget <> nil
|
if AInfo^.SpaceWidget <> nil
|
||||||
then gtk_table_attach(AInfo^.TableWidget, AInfo^.SpaceWidget,
|
then gtk_table_attach(AInfo^.TableWidget, AInfo^.SpaceWidget,
|
||||||
3, 4, 1, 3, 0, 0, 0, 0);
|
3, 4, 1, 3, GTK_SHRINK or GTK_FILL, GTK_SHRINK or GTK_FILL, 0, 0);
|
||||||
end;
|
end;
|
||||||
blGlyphTop: begin
|
blGlyphTop: begin
|
||||||
if AInfo^.ImageWidget <> nil
|
if AInfo^.ImageWidget <> nil
|
||||||
then gtk_table_attach(AInfo^.TableWidget, AInfo^.ImageWidget,
|
then gtk_table_attach(AInfo^.TableWidget, AInfo^.ImageWidget,
|
||||||
1, 3, 1, 2, 0, 0, 0, 0);
|
1, 3, 1, 2, GTK_SHRINK or GTK_FILL, GTK_SHRINK or GTK_FILL, 0, 0);
|
||||||
gtk_table_attach(AInfo^.TableWidget, AInfo^.LabelWidget,
|
gtk_table_attach(AInfo^.TableWidget, AInfo^.LabelWidget,
|
||||||
1, 3, 2, 3, 0, 0, 0, 0);
|
1, 3, 2, 3, GTK_SHRINK or GTK_FILL, GTK_SHRINK or GTK_FILL, 0, 0);
|
||||||
end;
|
end;
|
||||||
blGlyphBottom: begin
|
blGlyphBottom: begin
|
||||||
gtk_table_attach(AInfo^.TableWidget, AInfo^.LabelWidget,
|
gtk_table_attach(AInfo^.TableWidget, AInfo^.LabelWidget,
|
||||||
1, 3, 1, 2, 0, 0, 0, 0);
|
1, 3, 1, 2, GTK_SHRINK or GTK_FILL, GTK_SHRINK or GTK_FILL, 0, 0);
|
||||||
if AInfo^.ImageWidget <> nil
|
if AInfo^.ImageWidget <> nil
|
||||||
then gtk_table_attach(AInfo^.TableWidget, AInfo^.ImageWidget,
|
then gtk_table_attach(AInfo^.TableWidget, AInfo^.ImageWidget,
|
||||||
1, 3, 2, 3, 0, 0, 0, 0);
|
1, 3, 2, 3, GTK_SHRINK or GTK_FILL, GTK_SHRINK or GTK_FILL, 0, 0);
|
||||||
if AInfo^.SpaceWidget <> nil
|
if AInfo^.SpaceWidget <> nil
|
||||||
then gtk_table_attach(AInfo^.TableWidget, AInfo^.SpaceWidget,
|
then gtk_table_attach(AInfo^.TableWidget, AInfo^.SpaceWidget,
|
||||||
1, 3, 3, 4, 0, 0, 0, 0);
|
1, 3, 3, 4, GTK_SHRINK or GTK_FILL, GTK_SHRINK or GTK_FILL, 0, 0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user