[win] debug

This commit is contained in:
Maxim Kadushkin
2020-06-22 22:38:24 +03:00
parent fac7100408
commit 791d23c467
4 changed files with 18 additions and 6 deletions

View File

@ -45,9 +45,9 @@ void CCefEventsGate::onDocumentName(void * data)
RELEASEINTERFACE(pData);
}
void CCefEventsGate::onDocumentType(int id, int type)
void CCefEventsGate::onDocumentType(int, int type)
{
if (id) { type; }
m_panel->data()->setContentType(AscEditorType(type));
}
void CCefEventsGate::onDocumentSave(int, bool cancel)

View File

@ -65,7 +65,7 @@ public slots:
virtual void onDocumentPrint(int current, uint count) = 0;
virtual void onDocumentLoadFinished(int);
virtual void onDocumentReady(int);
virtual void onDocumentType(int, int type);
virtual void onDocumentType(int id, int type);
virtual void onFileLocation(int id, QString path) = 0;
virtual void onLocalFileSaveAs(void *) = 0;

View File

@ -240,9 +240,19 @@ public:
}
}
void onDocumentType(int, int type) override
void onDocumentType(int vid, int type) override
{
CCefEventsGate::onDocumentType(vid, type);
if ( canExtendTitle() && window->isCustomWindowStyle() ) {
QColor color;
switch (type) {
case etDocument: color = QColor(TAB_COLOR_DOCUMENT); break;
case etPresentation: color = QColor(TAB_COLOR_PRESENTATION); break;
case etSpreadsheet: color = QColor(TAB_COLOR_SPREADSHEET); break;
}
window->m_bgColor = RGB(color.red(), color.green(), color.blue());
window->m_css = prepare_editor_css(type);
QString css(AscAppManager::getWindowStylesheets(window->m_dpiRatio));

View File

@ -167,7 +167,7 @@ LRESULT CALLBACK CSingleWindowPlatform::WndProc(HWND hWnd, UINT message, WPARAM
} else
if ( top_window ) {
top_window = NULL;
if ( hw == AscAppManager::topWindow()->handle() )
if ( AscAppManager::topWindow() && hw == AscAppManager::topWindow()->handle() )
is_mainwindow_prev = true;
}
@ -179,8 +179,10 @@ LRESULT CALLBACK CSingleWindowPlatform::WndProc(HWND hWnd, UINT message, WPARAM
}
case WM_SETFOCUS: {
if ( !window->m_closed ) {
// window->focusMainPanel();
window->focus();
window->focus();
}
break;
}