mirror of https://github.com/KLayout/klayout.git
Bugfix: Browser's HTML panel was collapsed sometimes.
This commit is contained in:
parent
cea60b385f
commit
63819e3292
|
|
@ -77,7 +77,7 @@
|
|||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<widget class="QFrame" name="navigation_frame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
|
|
|
|||
|
|
@ -330,6 +330,8 @@ BrowserPanel::refresh_bookmark_list ()
|
|||
item->setData (0, Qt::ToolTipRole, tl::to_qstring (i->title));
|
||||
item->setData (0, Qt::DecorationRole, QIcon (":/bookmark_16.png"));
|
||||
}
|
||||
|
||||
update_navigation_panel ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -482,7 +484,7 @@ BrowserPanel::set_home (const std::string &url)
|
|||
QList<int> sizes = mp_ui->splitter->sizes ();
|
||||
if (sizes.size () >= 2) {
|
||||
int size_outline = 150;
|
||||
sizes[1] += sizes[0] - size_outline;
|
||||
sizes[1] += std::max (width () - 10 - size_outline, 10);
|
||||
sizes[0] = size_outline;
|
||||
}
|
||||
mp_ui->splitter->setSizes (sizes);
|
||||
|
|
@ -615,6 +617,13 @@ update_item_with_outline (const BrowserOutline &ol, QTreeWidgetItem *item)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
BrowserPanel::update_navigation_panel ()
|
||||
{
|
||||
bool navigation_visible = mp_ui->outline_tree->topLevelItemCount () > 0 || mp_ui->browser_bookmark_view->topLevelItemCount () > 0;
|
||||
mp_ui->navigation_frame->setVisible (navigation_visible);
|
||||
}
|
||||
|
||||
void
|
||||
BrowserPanel::set_outline (const BrowserOutline &ol)
|
||||
{
|
||||
|
|
@ -641,6 +650,8 @@ BrowserPanel::set_outline (const BrowserOutline &ol)
|
|||
mp_ui->outline_tree->expandAll ();
|
||||
|
||||
}
|
||||
|
||||
update_navigation_panel ();
|
||||
}
|
||||
|
||||
QVariant
|
||||
|
|
|
|||
|
|
@ -477,6 +477,7 @@ private:
|
|||
void add_bookmark (const BookmarkItem &item);
|
||||
void refresh_bookmark_list ();
|
||||
void store_bookmarks ();
|
||||
void update_navigation_panel ();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue