Skip to content

Commit

Permalink
Added some Qt6 parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
tsujan committed Oct 18, 2022
1 parent 88d474f commit 251cd3f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Kvantum/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
V1.0.6
---------
* Added a workaround for Kate's new status-bar and side-pane buttons, which still have wrong style codes.
* Updated a method that was deprecated by Qt 6.4.0.
* Added some Qt6 parameters.
* Silenced the compilation warnings with Qt 6.4.

V1.0.5
---------
Expand Down
2 changes: 1 addition & 1 deletion Kvantum/NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Latest version:

6 Oct 2022, V1.0.6
18 Oct 2022, V1.0.6

See "ChangeLog" for changes.
17 changes: 15 additions & 2 deletions Kvantum/style/Kvantum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13233,6 +13233,11 @@ int Style::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, c

case PM_TreeViewIndentation : return 20;

#if (QT_VERSION >= QT_VERSION_CHECK(6,3,0))
case PM_LineEditIconSize : return pixelMetric(PM_SmallIconSize);
case PM_LineEditIconMargin : return pixelMetric(PM_SmallIconSize) / 4;
#endif

default : return QCommonStyle::pixelMetric(metric,option,widget);
}
}
Expand Down Expand Up @@ -13446,6 +13451,12 @@ int Style::styleHint(QStyle::StyleHint hint,

case SH_TabBar_ElideMode : return Qt::ElideNone; // don't interfere with CE_TabBarTabLabel

#if (QT_VERSION >= QT_VERSION_CHECK(6,3,0))
case SH_TabBar_AllowWheelScrolling : return true;

case SH_Table_AlwaysDrawLeftTopGridLines : return false;
#endif

//case SH_ScrollBar_BackgroundMode : return Qt::OpaqueMode;

case SH_ScrollBar_ContextMenu : return !tspec_.transient_scrollbar; // because of the hover bug
Expand Down Expand Up @@ -13550,8 +13561,6 @@ int Style::styleHint(QStyle::StyleHint hint,
}
}

//case SH_SpinControls_DisableOnBounds: return true;

case SH_ToolTip_WakeUpDelay : {
if (tspec_.tooltip_delay >= 0)
return tspec_.tooltip_delay;
Expand All @@ -13565,7 +13574,11 @@ int Style::styleHint(QStyle::StyleHint hint,

case SH_ToolBox_SelectedPageTitleBold : return true;

case SH_SpinControls_DisableOnBounds: return true;
case SH_SpinBox_ButtonsInsideFrame : return true;
#if (QT_VERSION >= QT_VERSION_CHECK(6,3,0))
case SH_SpinBox_SelectOnStep : return true;
#endif

/* forms */
case SH_FormLayoutFieldGrowthPolicy : {
Expand Down
9 changes: 9 additions & 0 deletions Kvantum/style/standardIcons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,15 @@ QIcon Style::standardIcon(QStyle::StandardPixmap standardIcon,
else break;
}

#if (QT_VERSION >= QT_VERSION_CHECK(6,3,0))
case SP_TabCloseButton : {
QIcon icn = QIcon::fromTheme(QStringLiteral("tab-close"),
QIcon::fromTheme(QStringLiteral("window-close")));
if (!icn.isNull()) return icn;
else break;
}
#endif

default : break;
}

Expand Down

0 comments on commit 251cd3f

Please sign in to comment.