Window: Reparenting a window now keeps the title and the enabled state correctly.
[GB.GTK] * BUG: Window: Reparenting a window now keeps the title and the enabled state correctly. [GB.GTK3] * BUG: Window: Reparenting a window now keeps the title and the enabled state correctly.
This commit is contained in:
parent
58666e3f28
commit
7c87764c29
1 changed files with 17 additions and 4 deletions
|
@ -1141,11 +1141,20 @@ const char* gMainWindow::text()
|
||||||
|
|
||||||
void gMainWindow::setText(const char *txt)
|
void gMainWindow::setText(const char *txt)
|
||||||
{
|
{
|
||||||
if (_title) g_free(_title);
|
if (txt != _title)
|
||||||
_title = g_strdup(txt);
|
{
|
||||||
|
if (_title)
|
||||||
|
{
|
||||||
|
g_free(_title);
|
||||||
|
_title = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (txt && *txt)
|
||||||
|
_title = g_strdup(txt);
|
||||||
|
}
|
||||||
|
|
||||||
if (isTopLevel())
|
if (isTopLevel())
|
||||||
gtk_window_set_title(GTK_WINDOW(border), txt);
|
gtk_window_set_title(GTK_WINDOW(border), _title ? _title : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool gMainWindow::hasBorder()
|
bool gMainWindow::hasBorder()
|
||||||
|
@ -1453,7 +1462,6 @@ void gMainWindow::reparent(gContainer *newpr, int x, int y)
|
||||||
}
|
}
|
||||||
else if ((!isTopLevel() && !newpr)
|
else if ((!isTopLevel() && !newpr)
|
||||||
|| (isTopLevel() && isPopup()))
|
|| (isTopLevel() && isPopup()))
|
||||||
//|| (isTopLevel() && (isPopup() ^ (type == GTK_WINDOW_POPUP))))
|
|
||||||
{
|
{
|
||||||
gtk_window_remove_accel_group(GTK_WINDOW(topLevel()->border), accel);
|
gtk_window_remove_accel_group(GTK_WINDOW(topLevel()->border), accel);
|
||||||
// TODO: test that
|
// TODO: test that
|
||||||
|
@ -1473,6 +1481,7 @@ void gMainWindow::reparent(gContainer *newpr, int x, int y)
|
||||||
setBackground(bg);
|
setBackground(bg);
|
||||||
setForeground(fg);
|
setForeground(fg);
|
||||||
setFont(font());
|
setFont(font());
|
||||||
|
setText(text());
|
||||||
|
|
||||||
move(x, y);
|
move(x, y);
|
||||||
w = width();
|
w = width();
|
||||||
|
@ -1482,6 +1491,10 @@ void gMainWindow::reparent(gContainer *newpr, int x, int y)
|
||||||
resize(w, h);
|
resize(w, h);
|
||||||
|
|
||||||
hideHiddenChildren();
|
hideHiddenChildren();
|
||||||
|
|
||||||
|
gtk_widget_set_sensitive(frame, FALSE);
|
||||||
|
gtk_widget_set_sensitive(frame, TRUE);
|
||||||
|
|
||||||
_popup = false; //type == GTK_WINDOW_POPUP;
|
_popup = false; //type == GTK_WINDOW_POPUP;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue