mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 10:00:48 +02:00
Gtk2: fixed bug when tabwidget icon isn't updated when imageindex changed until it gets focus. fixes #16049
git-svn-id: trunk@24191 -
This commit is contained in:
parent
387e635060
commit
f2a96132c4
@ -247,8 +247,37 @@ begin
|
||||
end;
|
||||
|
||||
class procedure TGtkWSCustomPage.UpdateProperties(const ACustomPage: TCustomPage);
|
||||
{$ifdef gtk2}
|
||||
var
|
||||
NoteBook: PGtkWidget;
|
||||
PageWidget: PGtkWidget;
|
||||
TabWidget: PGtkWidget;
|
||||
TabImageWidget: PGtkWidget;
|
||||
{$endif}
|
||||
begin
|
||||
UpdateNotebookPageTab(nil, ACustomPage);
|
||||
{$ifdef gtk2}
|
||||
{we must update our icon (if exists) otherwise it will be updated only
|
||||
when our tab reach focus}
|
||||
if not ACustomPage.TabVisible
|
||||
or not ACustomPage.HandleAllocated
|
||||
or not Assigned(ACustomPage.Parent)
|
||||
then
|
||||
exit;
|
||||
|
||||
PageWidget := PGtkWidget(ACustomPage.Handle);
|
||||
NoteBook := PGtkWidget(ACustomPage.Parent.Handle);
|
||||
if (NoteBook = nil) or not GTK_IS_NOTEBOOK(NoteBook) then
|
||||
exit;
|
||||
|
||||
TabWidget := gtk_notebook_get_tab_label(PGtkNoteBook(Notebook), PageWidget);
|
||||
if (TabWidget = nil) or not GTK_WIDGET_VISIBLE(TabWidget) then
|
||||
exit;
|
||||
|
||||
TabImageWidget := gtk_object_get_data(PGtkObject(TabWidget), 'TabImage');
|
||||
if TabImageWidget <> nil then
|
||||
gtk_widget_queue_draw(TabImageWidget);
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
class procedure TGtkWSCustomPage.SetBounds(const AWinControl: TWinControl;
|
||||
|
Loading…
Reference in New Issue
Block a user