mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
Merge pull request 'Fix bug 52757' (#194) from feature/for-bug-52757 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/desktop-apps/pulls/194
This commit is contained in:
@ -289,7 +289,7 @@ int CAscTabWidget::addEditor(const COpenOptions& opts)
|
||||
tab_index = insertWidget(tab_index, panelwidget);
|
||||
m_pBar->insertTab(tab_index, data->title());
|
||||
m_pBar->setTabToolTip(tab_index, data->title());
|
||||
m_pBar->tabStartLoading(tab_index);
|
||||
m_pBar->setTabLoading(tab_index);
|
||||
|
||||
//TODO: test for safe remove
|
||||
// applyDocumentChanging(id_view, opts.type);
|
||||
@ -426,7 +426,7 @@ int CAscTabWidget::addPortal(const QString& url, const QString& name, const QStr
|
||||
m_pBar->setTabThemeType(tab_index, GetCurrentTheme().isDark() ? CTabBar::DarkTab : CTabBar::LightTab);
|
||||
m_pBar->setTabThemeIcons(tab_index, std::make_pair(":/tabbar/icons/portal.svg", ":/tabbar/icons/portal_light.svg"));
|
||||
m_pBar->setActiveTabColor(tab_index, QString::fromStdWString(GetColorValueByRole(ecrTabSimpleActiveBackground)));
|
||||
m_pBar->tabStartLoading(tab_index);
|
||||
m_pBar->setTabLoading(tab_index);
|
||||
// updateTabIcon(tabIndexByView(id));
|
||||
|
||||
return tab_index;
|
||||
@ -528,7 +528,10 @@ int CAscTabWidget::insertPanel(QWidget * panel, int index)
|
||||
m_pBar->setTabThemeType(tabindex,
|
||||
ui_theme.value(CTheme::ColorRole::ecrTabThemeType, L"dark") == L"dark" ? CTabBar::DarkTab : CTabBar::LightTab);
|
||||
break;
|
||||
default: break;
|
||||
default:
|
||||
if (!tabdata->isLocal())
|
||||
m_pBar->setTabLoading(tabindex);
|
||||
break;
|
||||
}
|
||||
|
||||
m_pBar->setActiveTabColor(tabindex, tabcolor);
|
||||
@ -866,6 +869,9 @@ void CAscTabWidget::applyDocumentChanging(int id, int type)
|
||||
default: break;
|
||||
}
|
||||
|
||||
if (AscEditorType::etUndefined != AscEditorType(type) && !panel(tabIndex)->data()->isLocal())
|
||||
m_pBar->setTabLoading(tabIndex, false);
|
||||
|
||||
m_pBar->setTabThemeType(tabIndex,
|
||||
ui_theme.value(CTheme::ColorRole::ecrTabThemeType, L"dark") == L"dark" ? CTabBar::DarkTab : CTabBar::LightTab);
|
||||
|
||||
@ -889,7 +895,8 @@ void CAscTabWidget::applyPageLoadingStatus(int id, int state)
|
||||
} else
|
||||
if ( state == DOCUMENT_CHANGED_PAGE_LOAD_FINISH ) {
|
||||
if ( !panel(tabIndex)->data()->eventLoadSupported() ) {
|
||||
m_pBar->setTabLoading(tabIndex, false);
|
||||
if (panel(tabIndex)->data()->isViewType(cvwtSimple))
|
||||
m_pBar->setTabLoading(tabIndex, false);
|
||||
panel(tabIndex)->applyLoader("hide");
|
||||
}
|
||||
}
|
||||
|
||||
@ -995,10 +995,13 @@ void CTabBar::setUseTabCustomPalette(int index, bool use)
|
||||
}
|
||||
}
|
||||
|
||||
void CTabBar::setTabLoading(int index, bool start)
|
||||
void CTabBar::setTabLoading(int index, bool start, const QString& theme)
|
||||
{
|
||||
if (!start) {
|
||||
if (CAnimatedIcon * icon = (CAnimatedIcon*)tabIconLabel(index))
|
||||
if (CAnimatedIcon * icon = (CAnimatedIcon*)tabIconLabel(index)) {
|
||||
if (start) {
|
||||
if (!icon->isStarted() )
|
||||
icon->startSvg(":/tabbar/icons/loader.svg", theme);
|
||||
} else
|
||||
icon->stop();
|
||||
}
|
||||
}
|
||||
@ -1017,13 +1020,6 @@ void CTabBar::setTabThemeIcons(int index, const std::pair<QString, QString> & ic
|
||||
}
|
||||
}
|
||||
|
||||
void CTabBar::tabStartLoading(int index, const QString& theme)
|
||||
{
|
||||
CAnimatedIcon * icon = (CAnimatedIcon*)tabIconLabel(index);
|
||||
if (icon && !icon->isStarted() )
|
||||
icon->startSvg(":/tabbar/icons/loader.svg", theme);
|
||||
}
|
||||
|
||||
void CTabBar::polish()
|
||||
{
|
||||
for (int i = 0; i < d->tabList.size(); i++)
|
||||
|
||||
@ -72,10 +72,9 @@ public:
|
||||
void setCurrentIndex(int index);
|
||||
void setActiveTabColor(int index, const QString&);
|
||||
void setUseTabCustomPalette(int, bool);
|
||||
void setTabLoading(int, bool);
|
||||
void setTabLoading(int, bool start = true, const QString& theme = QString());
|
||||
void setTabThemeType(int, TabTheme);
|
||||
void setTabThemeIcons(int, const std::pair<QString, QString> &);
|
||||
void tabStartLoading(int, const QString& theme = QString());
|
||||
void polish();
|
||||
void activate(bool);
|
||||
void refreshTheme();
|
||||
|
||||
@ -1617,6 +1617,7 @@ void CMainWindow::onErrorPage(int id, const std::wstring& action)
|
||||
if ( view && cvwtEditor == view->GetType() && action.compare(L"open") == 0 ) {
|
||||
int ind = m_pTabs->tabIndexByView(id);
|
||||
m_pTabs->panel(ind)->data()->setHasError();
|
||||
m_pTabs->tabBar()->setTabLoading(ind, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user