[win] support for 150% scaling
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 261 B |
|
Before Width: | Height: | Size: 215 B After Width: | Height: | Size: 215 B |
|
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 480 B |
|
Before Width: | Height: | Size: 735 B After Width: | Height: | Size: 735 B |
|
Before Width: | Height: | Size: 609 B After Width: | Height: | Size: 609 B |
308
win-linux/res/styles/styles@1.5x.qss
Normal file
@ -0,0 +1,308 @@
|
||||
|
||||
#labelAppTitle {
|
||||
margin-top: -3px;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
QPushButton#toolButtonDownload {
|
||||
padding: 9px;
|
||||
}
|
||||
|
||||
QPushButton#toolButtonMaximize,QPushButton#toolButtonMinimize,
|
||||
QPushButton#toolButtonClose {
|
||||
padding: 8px 18px 11px;
|
||||
}
|
||||
|
||||
QPushButton#toolButtonMaximize {
|
||||
background-image:url(:/maximize_1.5x.png);
|
||||
}
|
||||
|
||||
QPushButton#toolButtonMinimize, QPushButton#toolButtonClose {
|
||||
background-image:url(:/minimize-close_1.5x.png);
|
||||
}
|
||||
|
||||
QPushButton#toolButtonMain {
|
||||
/*font-size: 20px;*/
|
||||
border-right-width: 2px;
|
||||
}
|
||||
|
||||
QPushButton#toolButtonMain[theme=light] {
|
||||
border-width: 2px;
|
||||
border-bottom: 0 none;
|
||||
}
|
||||
|
||||
QPushButton#toolButtonMain[class=normal],
|
||||
QPushButton#toolButtonMain[class=normal]:hover
|
||||
{
|
||||
border-bottom-width: 2px;
|
||||
}
|
||||
|
||||
QPushButton::menu-indicator {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-image: url(:/menu-indicator_1.5x.png) 0 0 0 0 repeat repeat;
|
||||
left: -3px;
|
||||
top: -2px;
|
||||
}
|
||||
|
||||
QPushButton::menu-indicator:disabled {
|
||||
border-image: url(:/menu-indicator_1.5x.png) 0 0 0 15 repeat repeat;
|
||||
}
|
||||
|
||||
QPushButton::menu-indicator:hover {
|
||||
border-image: url(:/menu-indicator_1.5x.png) 0 15 0 0 repeat repeat;
|
||||
}
|
||||
|
||||
QPushButton#toolButtonDownload::menu-indicator {
|
||||
top: -15px;
|
||||
left: -6px;
|
||||
}
|
||||
|
||||
/**************************/
|
||||
/* dark theme definitions */
|
||||
/**************************/
|
||||
|
||||
#mainPanel[uitheme=theme-dark] QPushButton#toolButtonMaximize {
|
||||
background-image:url(:/max_light_1.5x.png);
|
||||
}
|
||||
|
||||
#mainPanel[uitheme=theme-dark] QPushButton#toolButtonMinimize,
|
||||
#mainPanel[uitheme=theme-dark] QPushButton#toolButtonClose
|
||||
{
|
||||
background-image:url(:/minclose_light_1.5x.png);
|
||||
}
|
||||
|
||||
/**************************/
|
||||
|
||||
QTabBar {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
QTabBar::tab {
|
||||
padding-left: 11px;
|
||||
}
|
||||
|
||||
QTabBar::tab {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
QTabBar::close-button {
|
||||
}
|
||||
|
||||
QTabBar::close-button:hover {
|
||||
}
|
||||
|
||||
QTabBar::close-button:pressed {
|
||||
}
|
||||
|
||||
QTabBar QToolButton,
|
||||
QTabBar QToolButton:disabled {
|
||||
margin-right:-2px;
|
||||
border-width:2px;
|
||||
}
|
||||
|
||||
QTabBar[scroll=var2] QToolButton::left-arrow,
|
||||
QTabBar QToolButton::left-arrow {
|
||||
border-image: url(:/tabbar/icons/scrolltab_ln_2x.png) 0;
|
||||
border-width:16px 0 16px 2px;
|
||||
}
|
||||
|
||||
QTabBar QToolButton::left-arrow:disabled {
|
||||
border-image: url(:/tabbar/icons/scrolltab_ld_2x.png) 0;
|
||||
}
|
||||
|
||||
QTabBar QToolButton::left-arrow:hover {
|
||||
border-image: url(:/tabbar/icons/scrolltab_lh_2x.png) 0;
|
||||
}
|
||||
|
||||
QTabBar QToolButton::left-arrow:pressed {
|
||||
border-image: url(:/tabbar/icons/scrolltab_lp_2x.png) 0;
|
||||
}
|
||||
|
||||
QTabBar[scroll=var2] QToolButton::right-arrow,
|
||||
QTabBar QToolButton::right-arrow {
|
||||
border-image: url(:/tabbar/icons/scrolltab_rn_2x.png) 0;
|
||||
/*border-width:12px;*/
|
||||
border-width:16px 0 16px 26px;
|
||||
}
|
||||
|
||||
QTabBar QToolButton::right-arrow:disabled {
|
||||
border-image: url(:/tabbar/icons/scrolltab_rd_2x.png) 0;
|
||||
}
|
||||
|
||||
QTabBar QToolButton::right-arrow:hover {
|
||||
border-image: url(:/tabbar/icons/scrolltab_rh_2x.png) 0;
|
||||
}
|
||||
QTabBar QToolButton::right-arrow:pressed {
|
||||
border-image: url(:/tabbar/icons/scrolltab_rp_2x.png) 0;
|
||||
}
|
||||
|
||||
QTabBar[scroll=var2]::scroller,
|
||||
QTabBar::scroller {
|
||||
width:48px;
|
||||
}
|
||||
|
||||
QTabBar QToolButton[class=tab-close]{
|
||||
background-image:url(:/tabbar/icons/close_normal_1.5x.png);
|
||||
}
|
||||
QTabBar QToolButton[class=tab-close][state=active]{
|
||||
background-image:url(:/tabbar/icons/close_active_1.5x.png);
|
||||
}
|
||||
QTabBar QToolButton[class=tab-close]:hover{
|
||||
border-right:2px solid #fff; /* ??? pixmap offsets on hover for 2px ??? */
|
||||
}
|
||||
|
||||
/* download widget */
|
||||
QMenu[hdpi]#menuButtonDownload {
|
||||
border-width: 2px;
|
||||
}
|
||||
|
||||
CDownloadWidget[hdpi] QProgressBar {
|
||||
border-radius: 4px;
|
||||
max-height: 10px;
|
||||
margin-right: 20px;
|
||||
margin-top: 2px;
|
||||
min-width: 400px;
|
||||
}
|
||||
|
||||
CDownloadWidget[hdpi] QProgressBar::chunk {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
CDownloadWidget[hdpi] QPushButton#buttonCancel {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
CDownloadWidget[hdpi] QLabel#labelName {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
QPushButton {
|
||||
border: 2px solid #cbcbcb;
|
||||
padding:0 40px;
|
||||
height: 44px;
|
||||
border-radius:4px;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
QDialog QPushButton {
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
QLabel[class=tab-icon] {
|
||||
padding:0 0 4px 12px;
|
||||
}
|
||||
|
||||
QPrintDialog QLabel {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
QPrintDialog QToolButton{
|
||||
border-width: 1px;
|
||||
border-radius:4px;
|
||||
height: 44px;
|
||||
}
|
||||
|
||||
QPrintDialog QLineEdit{
|
||||
font-size: 22px;
|
||||
border-width: 2px;
|
||||
height: 44px;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
QPrintDialog QGroupBox {
|
||||
border-width: 2px;
|
||||
margin-top: 8ex;
|
||||
border-radius:4px;
|
||||
font-size: 22px;
|
||||
padding:16px;
|
||||
}
|
||||
|
||||
QPrintDialog QComboBox{
|
||||
border-width: 2px;
|
||||
font-size: 22px;
|
||||
height: 44px;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
QPrintDialog QComboBox QAbstractItemView {
|
||||
border-width: 2px;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
QPrintDialog QRadioButton::indicator{
|
||||
width:26px;
|
||||
height:26px;
|
||||
}
|
||||
|
||||
QPrintDialog QRadioButton, QPrintDialog QCheckBox {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
QPrintDialog QRadioButton::indicator::unchecked{
|
||||
border-image: url(:/radiobox_2x.png) 0 0 0 0 repeat repeat;
|
||||
}
|
||||
|
||||
QPrintDialog QRadioButton::indicator::checked{
|
||||
border-image: url(:/radiobox_2x.png) 26 0 0 0 repeat repeat;
|
||||
}
|
||||
|
||||
QPrintDialog QCheckBox::indicator{
|
||||
width:28px;
|
||||
height:28px;
|
||||
}
|
||||
|
||||
QPrintDialog QCheckBox::indicator::checked{
|
||||
border-image: url(:/checkbox_2x.png) 28 0 0 0 repeat repeat;
|
||||
}
|
||||
|
||||
QPrintDialog QCheckBox::indicator::unchecked{
|
||||
border-image: url(:/checkbox_2x.png) 0 0 0 0 repeat repeat;
|
||||
}
|
||||
|
||||
QSpinBox, QDoubleSpinBox, QTimeEdit {
|
||||
border-width: 2px;
|
||||
border-radius:4px;
|
||||
height:44px;
|
||||
font-size:22px;
|
||||
}
|
||||
|
||||
QPrintDialog *::up-arrow, QPrintDialog *::down-arrow {
|
||||
width: 10px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
QPrintDialog *::up-arrow {
|
||||
border-image: url(:/arrow_down_2x.png) 6 0 0 0 repeat repeat;
|
||||
margin-bottom:1px;
|
||||
}
|
||||
|
||||
QPrintDialog *::up-arrow:disabled, QPrintDialog *::up-arrow:off {
|
||||
border-image: url(:/arrow_down_2x.png) 6 0 0 10 repeat repeat;
|
||||
}
|
||||
|
||||
QPrintDialog *::down-arrow {
|
||||
border-image: url(:/arrow_down_2x.png) 0 0 0 0 repeat repeat;
|
||||
margin-top:1px;
|
||||
}
|
||||
|
||||
QPrintDialog *::down-arrow:disabled, QPrintDialog ::down-arrow:off {
|
||||
border-image: url(:/arrow_down_2x.png) 0 0 0 10 repeat repeat;
|
||||
}
|
||||
|
||||
QPrintDialog QTabWidget::pane{
|
||||
border-width: 2px;
|
||||
top: -2px;
|
||||
}
|
||||
QPrintDialog QTabBar::tab {
|
||||
border-width: 2px;
|
||||
padding: 0 20px;
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
margin-right:-2px;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
QPrintDialog QTabBar::tab:selected {
|
||||
padding: 0 20px;
|
||||
}
|
||||
17
win-linux/res/styles/tabbar@1.5x.qss
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
QTabWidget::pane {background-color: #f1f1f1; border:none;}
|
||||
QTabWidget::tab-bar {width: auto; height: 42px; left: 168px; }
|
||||
|
||||
QTabBar::tab { width:203px; background-color: #f1f1f1; border: 0 none; min-width: 62px; max-width: 203px;
|
||||
height: 42px; margin: 0 0 0 0; }
|
||||
|
||||
QTabBar::tab {border-right: 2px solid #a5a5a5;}
|
||||
QTabBar::tab:hover{background-color: #cecece;}
|
||||
QTabBar::tab:selected{background-color: #515252;}
|
||||
QTabBar::tab-label{active:#fff;normal:#444;}
|
||||
QTabBar::tab-icon{width:15;height:15;}
|
||||
|
||||
#mainPanel[uitheme=theme-dark] QTabWidget::pane {background-color: #404040;}
|
||||
|
||||
QTabWidget[active=false] QTabBar::tab:selected {background-color: #f1f1f1;}
|
||||
QTabWidget[active=false] QTabBar::tab:selected:hover {background-color: #cecece;}
|
||||
@ -11,11 +11,14 @@
|
||||
<file>res/icons/downloading.gif</file>
|
||||
<file>res/icons/downloading_2x.gif</file>
|
||||
<file>res/icons/minimize-close.png</file>
|
||||
<file alias="minimize-close_1.5x.png">res/icons/minimize-close@1.5x.png</file>
|
||||
<file alias="minimize-close_2x.png">res/icons/minimize-close@2x.png</file>
|
||||
<file>res/icons/maximize.png</file>
|
||||
<file alias="maximize_1.5x.png">res/icons/maximize@1.5x.png</file>
|
||||
<file alias="maximize_2x.png">res/icons/maximize@2x.png</file>
|
||||
<file>res/icons/menu-indicator.png</file>
|
||||
<file>res/icons/menu-indicator-dark.png</file>
|
||||
<file alias="menu-indicator_1.5x.png">res/icons/menu-indicator@1.5x.png</file>
|
||||
<file>res/icons/menu-indicator_2x.png</file>
|
||||
<file>res/icons/radiobox.png</file>
|
||||
<file alias="radiobox_2x.png">res/icons/radiobox@2x.png</file>
|
||||
@ -27,13 +30,16 @@
|
||||
<file>res/icons/splash.png</file>
|
||||
<file>res/icons/splash_2x.png</file>
|
||||
<file alias="logo_dark.png">res/icons/logo_dark.png</file>
|
||||
<file alias="logo_dark@1.5x.png">res/icons/logo_dark_1.5x.png</file>
|
||||
<file alias="logo_dark@2x.png">res/icons/logo_dark_2x.png</file>
|
||||
<file alias="logo_light.png">res/icons/logo_light.png</file>
|
||||
<file alias="logo_light@1.5x.png">res/icons/logo_light_1.5x.png</file>
|
||||
<file alias="logo_light@2x.png">res/icons/logo_light_2x.png</file>
|
||||
<file alias="max_light.png">res/icons/maximize_light.png</file>
|
||||
<file alias="max_light_1.5x.png">res/icons/maximize_light@1.5x.png</file>
|
||||
<file alias="max_light_2x.png">res/icons/maximize_light@2x.png</file>
|
||||
<file alias="minclose_light.png">res/icons/minimize-close_light.png</file>
|
||||
<file alias="minclose_light_1.5x.png">res/icons/minimize-close_light@1.5x.png</file>
|
||||
<file alias="minclose_light_2x.png">res/icons/minimize-close_light@2x.png</file>
|
||||
<file alias="dock.png">res/icons/dock.png</file>
|
||||
<file alias="dock_2x.png">res/icons/dock@2x.png</file>
|
||||
@ -69,8 +75,10 @@
|
||||
<file alias="newdoc@2x.png">res/icons/tabbar/tabicon_undefined_2x.png</file>
|
||||
<file alias="loader.svg">res/icons/tabbar/loading.svg</file>
|
||||
<file alias="close_normal.png">res/icons/tabbar/tab_close_dark.png</file>
|
||||
<file alias="close_normal_1.5x.png">res/icons/tabbar/tab_close_dark@1.5x.png</file>
|
||||
<file alias="close_normal_2x.png">res/icons/tabbar/tab_close_dark@2x.png</file>
|
||||
<file alias="close_active.png">res/icons/tabbar/tab_close_light.png</file>
|
||||
<file alias="close_active_1.5x.png">res/icons/tabbar/tab_close_light@1.5x.png</file>
|
||||
<file alias="close_active_2x.png">res/icons/tabbar/tab_close_light@2x.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/title/icons">
|
||||
@ -81,6 +89,9 @@
|
||||
<file>res/styles/styles.qss</file>
|
||||
<file alias="message.qss">res/styles/message.qss</file>
|
||||
</qresource>
|
||||
<qresource prefix="/styles@1.5x">
|
||||
<file alias="styles.qss">res/styles/styles@1.5x.qss</file>
|
||||
</qresource>
|
||||
<qresource prefix="/styles@2x">
|
||||
<file alias="styles.qss">res/styles/styles@2x.qss</file>
|
||||
</qresource>
|
||||
@ -101,6 +112,7 @@
|
||||
<qresource prefix="/sep-styles">
|
||||
<file alias="tabbar.qss">res/styles/tabbar.qss</file>
|
||||
<file alias="tabbar.nix.qss">res/styles/tabbar_nix.qss</file>
|
||||
<file alias="tabbar@1.5x.qss">res/styles/tabbar@1.5x.qss</file>
|
||||
<file alias="tabbar@2x.qss">res/styles/tabbar@2x.qss</file>
|
||||
<file alias="tabbar@2x.nix.qss">res/styles/tabbar_nix@2x.qss</file>
|
||||
</qresource>
|
||||
|
||||
@ -895,6 +895,7 @@ void CAscApplicationManagerWrapper::initializeApp()
|
||||
}
|
||||
|
||||
_app.addStylesheets(CScalingFactor::SCALING_FACTOR_1, ":styles/res/styles/styles.qss");
|
||||
_app.addStylesheets(CScalingFactor::SCALING_FACTOR_1_5, ":styles@1.5x/styles.qss");
|
||||
_app.addStylesheets(CScalingFactor::SCALING_FACTOR_2, ":styles@2x/styles.qss");
|
||||
|
||||
_app.m_private->applyStylesheets();
|
||||
@ -1273,6 +1274,9 @@ QString CAscApplicationManagerWrapper::getWindowStylesheets(double dpifactor)
|
||||
{
|
||||
if ( !(dpifactor < 2) )
|
||||
return getWindowStylesheets(CScalingFactor::SCALING_FACTOR_2);
|
||||
else
|
||||
if ( !(dpifactor < 1.5) )
|
||||
return getWindowStylesheets(CScalingFactor::SCALING_FACTOR_1_5);
|
||||
else return getWindowStylesheets(CScalingFactor::SCALING_FACTOR_1);
|
||||
}
|
||||
|
||||
|
||||
@ -78,6 +78,7 @@ struct sWinTag {
|
||||
enum class CScalingFactor
|
||||
{
|
||||
SCALING_FACTOR_1,
|
||||
SCALING_FACTOR_1_5,
|
||||
SCALING_FACTOR_2,
|
||||
};
|
||||
|
||||
|
||||
@ -1258,7 +1258,7 @@ void CMainPanel::updateScaling(double dpiratio)
|
||||
|
||||
m_pButtonMain->setGeometry(0, 0, int(BUTTON_MAIN_WIDTH * dpiratio), int(TITLE_HEIGHT * dpiratio));
|
||||
|
||||
QString _tabs_stylesheets = dpiratio > 1 ? ":/sep-styles/tabbar@2x" : ":/sep-styles/tabbar";
|
||||
QString _tabs_stylesheets = dpiratio > 1.55 ? ":/sep-styles/tabbar@2x" : dpiratio > 1.1 ? ":/sep-styles/tabbar@1.5x" : ":/sep-styles/tabbar";
|
||||
if ( m_isCustomWindow ) {
|
||||
_tabs_stylesheets += ".qss";
|
||||
} else {
|
||||
|
||||
@ -95,7 +95,7 @@ void CMainPanelImpl::updateScaling(double dpiratio)
|
||||
std::wstring prefix{AscAppManager::themes().value(CThemes::ColorRole::ecrLogoColor)};
|
||||
QString logo_name = QString(":/logo_%1%2.png")
|
||||
.arg(QString::fromStdWString(prefix))
|
||||
.arg(dpiratio > 1 ? dpiratio > 1.5 ? "@2x" : "@1.5x" : "");
|
||||
.arg(dpiratio > 1.55 ? "@2x" : dpiratio > 1.1 ? "@1.5x" : "");
|
||||
// QPixmap pixmap(dpiratio > 1 ? ":/logo@2x.png" : ":/logo.png");
|
||||
QPixmap pixmap(logo_name);
|
||||
m_pButtonMain->setText(QString());
|
||||
@ -107,11 +107,11 @@ void CMainPanelImpl::applyTheme(const std::wstring& theme)
|
||||
{
|
||||
CMainPanel::applyTheme(theme);
|
||||
|
||||
int dpiratio = scaling();
|
||||
double dpiratio = scaling();
|
||||
std::wstring prefix{AscAppManager::themes().value(theme, CThemes::ColorRole::ecrLogoColor)};
|
||||
QString logo_name = QString(":/logo_%1%2.png")
|
||||
.arg(QString::fromStdWString(prefix))
|
||||
.arg(dpiratio > 1 ? dpiratio > 1.5 ? "@2x" : "@1.5x" : "");
|
||||
.arg(dpiratio > 1.55 ? "@2x" : dpiratio > 1.1 ? "@1.5x" : "");
|
||||
QPixmap pixmap(logo_name);
|
||||
m_pButtonMain->setText(QString());
|
||||
m_pButtonMain->setIcon(QIcon(pixmap));
|
||||
|
||||
@ -379,7 +379,7 @@ double Utils::getScreenDpiRatio(int scrnum)
|
||||
unsigned int _dpi_x = 0;
|
||||
unsigned int _dpi_y = 0;
|
||||
double nScale = AscAppManager::getInstance().GetMonitorScaleByIndex(scrnum, _dpi_x, _dpi_y);
|
||||
return (-1 == nScale) ? 1 : nScale;
|
||||
return nScale > 1.5 ? 2 : nScale > 1 ? 1.5 : 1;
|
||||
}
|
||||
|
||||
double Utils::getScreenDpiRatio(const QPoint& pt)
|
||||
@ -399,7 +399,7 @@ double Utils::getScreenDpiRatioByHWND(int hwnd)
|
||||
unsigned int _dpi_x = 0;
|
||||
unsigned int _dpi_y = 0;
|
||||
double nScale = AscAppManager::getInstance().GetMonitorScaleByWindow((WindowHandleId)hwnd, _dpi_x, _dpi_y);
|
||||
return (-1 == nScale) ? 1 : nScale;
|
||||
return nScale > 1.5 ? 2 : nScale > 1 ? 1.5 : 1;
|
||||
}
|
||||
|
||||
double Utils::getScreenDpiRatioByWidget(QWidget* wid)
|
||||
@ -419,8 +419,8 @@ double Utils::getScreenDpiRatioByWidget(QWidget* wid)
|
||||
if (nRet >= 0) {
|
||||
double dDpiApp = pDpiChecker->GetScale(nDpiX, nDpiY);
|
||||
|
||||
// пока только 1 или 2
|
||||
return (dDpiApp > 1.9) ? 2 : 1;
|
||||
// пока только 1, 1.5 или 2
|
||||
return dDpiApp > 1.5 ? 2 : dDpiApp > 1 ? 1.5 : 1;
|
||||
}
|
||||
|
||||
return wid->devicePixelRatio();
|
||||
|
||||