Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • P Plasma Breeze visual style
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 5
    • Issues 5
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PlasmaPlasma
  • Plasma Breeze visual style
  • Issues
  • #12
Closed
Open
Issue created Aug 11, 2021 by Nyan Pasu@nyanpasu🐈Contributor

QDoubleSpinBox (and QDateTimePicker) not centered like QSpinBox

5e9c6575 attempted to center spinbox text, but only managed to do so for QSpinBox, not other subclasses of QAbstractSpinBox.

I think QDoubleSpinBox obviously benefits from centering, but I'm not sure about QDateTimePicker, since I'm not sure how it's used in practice. So I don't know whether to center all QAbstractSpinBox or only QSpinBox and QAbstractSpinBox.

I rebuilt Breeze locally with all QAbstractSpinBox centered, and whipped up a test program for QDateTimePicker. I think that using it as a month picker looks good when centered (but I'm not sure about a numeric date/time picker):

qdatetimepicker_centered

Patch:

diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp
index 608f40b7..c631340e 100644
--- a/kstyle/breezestyle.cpp
+++ b/kstyle/breezestyle.cpp
@@ -40,7 +40,7 @@
 #include <QRadioButton>
 #include <QScrollBar>
 #include <QItemDelegate>
-#include <QSpinBox>
+#include <QAbstractSpinBox>
 #include <QSplitterHandle>
 #include <QTextEdit>
 #include <QToolBar>
@@ -419,7 +419,7 @@ namespace Breeze
             widget->setAttribute(Qt::WA_StyledBackground);
         } else if ( auto btn = qobject_cast<QPushButton*> (widget) ) {
             btn->setAutoDefault(false);
-        } else if ( auto spbx = qobject_cast<QSpinBox*> (widget) ) {
+        } else if ( auto spbx = qobject_cast<QAbstractSpinBox*> (widget) ) {
             spbx->setAlignment(Qt::AlignCenter);
         }
 
Edited Aug 11, 2021 by Nyan Pasu
Assignee
Assign to
Time tracking