[win-nix] fix cefview's background color

This commit is contained in:
maxkadushkin
2025-10-10 18:43:23 +03:00
parent b730b9232c
commit ce98f6f0cf
3 changed files with 11 additions and 2 deletions

View File

@ -855,6 +855,8 @@ CMainWindow * CAscApplicationManagerWrapper::prepareMainWindow(const QRect& r)
QPointer<QCefView> _startPanel = AscAppManager::createViewer(nullptr, CWindowBase::expectedContentSize(_start_rect));
_startPanel->Create(&_app, cvwtSimple);
_startPanel->setObjectName("startPanel");
QColor c = m_themes.current().color(CTheme::ColorRole::ecrWindowBackground);
_startPanel->SetBackgroundCefColor(uchar(c.red()), uchar(c.green()), uchar(c.blue()));
//_startPanel->resize(_start_rect.width(), _start_rect.height());
CMainWindow * _window = static_cast<CMainWindow*>(new CMainWindowImpl(_start_rect));

View File

@ -10,12 +10,18 @@ using namespace NSEditorApi;
CTabPanel * CTabPanel::createEditorPanel(QWidget *parent, const QSize& s)
{
CTabPanel * panel = new CTabPanel(parent, s);
QColor c = AscAppManager::themes().current().color(CTheme::ColorRole::ecrWindowBackground);
CTabPanel * panel = new CTabPanel(parent, s, c);
panel->initAsEditor();
return panel;
}
CTabPanel::CTabPanel(QWidget *parent, const QSize& s)
: CTabPanel(parent, s, QColor(244,244,244))
{
}
CTabPanel::CTabPanel(QWidget *parent, const QSize& s, const QColor& c)
: QWidget(parent)
, m_pViewer(AscAppManager::createViewer(this, s))
{
@ -25,7 +31,7 @@ CTabPanel::CTabPanel(QWidget *parent, const QSize& s)
_layout->addWidget(m_pViewer);
setLayout(_layout);
m_pViewer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_pViewer->SetBackgroundCefColor(244, 244, 244);
m_pViewer->SetBackgroundCefColor(uchar(c.red()), uchar(c.green()), uchar(c.blue()));
setAttribute(Qt::WA_DontCreateNativeAncestors);
setAttribute(Qt::WA_NativeWindow);

View File

@ -13,6 +13,7 @@ class CTabPanel : public QWidget
public:
explicit CTabPanel(QWidget *parent, const QSize& s);
explicit CTabPanel(QWidget *parent, const QSize& s, const QColor& c);
~CTabPanel();
static CTabPanel * createEditorPanel(QWidget *parent, const QSize& size);