mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-08 18:19:42 +00:00
Refactorize GuiView::showView.
This way we get rid of pop-uping of widgets when ~/.config/LyX is re-created and yet we still have title and enabling status correct when widgets are restored from session. Some details in bug #5082. This is candidate for branch too. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30144 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
65f641ac1d
commit
a45c849f3b
src/frontends/qt4
@ -153,7 +153,7 @@ void Dialog::apply()
|
||||
}
|
||||
|
||||
|
||||
void Dialog::showView()
|
||||
void Dialog::prepareView()
|
||||
{
|
||||
// Make sure the dialog controls are correctly enabled/disabled with
|
||||
// readonly status.
|
||||
@ -165,7 +165,14 @@ void Dialog::showView()
|
||||
QSize const hint = w->sizeHint();
|
||||
if (hint.height() >= 0 && hint.width() >= 0)
|
||||
w->setMinimumSize(hint);
|
||||
}
|
||||
|
||||
|
||||
void Dialog::showView()
|
||||
{
|
||||
prepareView();
|
||||
|
||||
QWidget * w = asQWidget();
|
||||
if (w->isVisible()) {
|
||||
w->raise();
|
||||
w->activateWindow();
|
||||
|
@ -121,9 +121,12 @@ public:
|
||||
/// Hide the dialog from sight
|
||||
void hideView();
|
||||
|
||||
/// Create the dialog if necessary, update it and display it.
|
||||
/// Prepare dialog and display it.
|
||||
void showView();
|
||||
|
||||
/// Prepare dialog before view.
|
||||
void prepareView();
|
||||
|
||||
/// Decide wether the dialog should grab thekeyboard focus when shown.
|
||||
/// This method defaults to true, override if a different behaviour
|
||||
/// is wanted.
|
||||
|
@ -378,6 +378,7 @@ bool GuiView::restoreLayout()
|
||||
if (!settings.contains(icon_key))
|
||||
return false;
|
||||
|
||||
//code below is skipped when when ~/.config/LyX is (re)created
|
||||
setIconSize(settings.value(icon_key).toSize());
|
||||
#ifdef Q_WS_X11
|
||||
QPoint pos = settings.value("pos", QPoint(50, 50)).toPoint();
|
||||
@ -393,11 +394,12 @@ bool GuiView::restoreLayout()
|
||||
|
||||
// Allow the toc and view-source dock widget to be restored if needed.
|
||||
Dialog *d;
|
||||
if ((d = findOrBuild("toc", true)))
|
||||
// see bug 5082
|
||||
d->showView();
|
||||
if ((d = findOrBuild("toc", true)));
|
||||
// see bug 5082. At least setup title and enabled state.
|
||||
// Visibility will be adjusted by restoreState below.
|
||||
d->prepareView();
|
||||
if ((d = findOrBuild("view-source", true)))
|
||||
d->showView();
|
||||
d->prepareView();
|
||||
|
||||
if (!restoreState(settings.value("layout").toByteArray(), 0))
|
||||
initToolbars();
|
||||
|
Loading…
Reference in New Issue
Block a user