mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-08-03 20:56:49 -04:00
Only One of ReadingList&TOC Visible
Two side bar will be mutually exclusive.
This commit is contained in:
parent
7d7d238a47
commit
7db13c9c26
@ -23,8 +23,18 @@ WebPage::WebPage(QObject *parent) :
|
||||
channel->registerObject("kiwixChannelObj", kiwixChannelObj);
|
||||
|
||||
auto app = KiwixApp::instance();
|
||||
connect(app->getAction(KiwixApp::ToggleTOCAction), &QAction::toggled,
|
||||
auto tocAction = app->getAction(KiwixApp::ToggleTOCAction);
|
||||
auto readingListAction = app->getAction(KiwixApp::ToggleReadingListAction);
|
||||
connect(tocAction, &QAction::toggled,
|
||||
kiwixChannelObj, &KiwixWebChannelObject::tocVisibleChanged);
|
||||
connect(readingListAction, &QAction::toggled, this, [=](bool visible){
|
||||
if (visible && tocAction->isChecked())
|
||||
tocAction->toggle();
|
||||
});
|
||||
connect(tocAction, &QAction::toggled, this, [=](bool visible){
|
||||
if (visible && readingListAction->isChecked())
|
||||
readingListAction->toggle();
|
||||
});
|
||||
}
|
||||
|
||||
bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType /*type*/, bool /*isMainFrame*/)
|
||||
|
Loading…
x
Reference in New Issue
Block a user