Commit Graph

206 Commits

Author SHA1 Message Date
Alessandro Portale
02637390fa ManhattanStyle: Draw round rectangles in "Relaxed toolbar style"
Task-number: QTCREATORBUG-29054
Change-Id: Ic06ddfec87fd9b43c88b3a7dfb9946c3a8b22c60
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-05 11:36:25 +00:00
Alessandro Portale
2e9494bd71 Core: Add "Toolbar Style" ComboBox to General settings
Stores the style as int under General/ToolbarStyle. ManhattanStyle
restores the setting on contruction, just in time before widgets
get "QStyle::polished".

Task-number: QTCREATORBUG-29054
Change-Id: Ifea953261eab0d42e35a128e2f3338fbbef06a88
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-05-05 11:35:28 +00:00
Tim Jenssen
adb664f521 Merge remote-tracking branch 'origin/qds/dev'
Conflicts: src/libs/utils/filepath.cpp
  src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp
  src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp
  tests/unit/unittest/CMakeLists.txt

Change-Id: I017a6075db41a5233487ac855ffe23de2b2bb0ee
2023-03-30 13:30:42 +00:00
Ali Kianian
5644fa1b9c QmlDesigner: Move StyleAnimator to Utils
StyleAnimator moved to Utils in order to be used by other modules and
styles.
Since Utils is the most common dependency, it's chosen as the right
place of StyleAnimator.

Task-number: QDS-9522
Change-Id: Idbf55875e0c320ccfa21e1c479bf5997ea7d150d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-03-28 10:13:28 +00:00
Tim Jenßen
feabda3aa7 Merge remote-tracking branch 'origin/10.0' into qds/dev
bigger conflicts resolved at:
  src/plugins/qmldesigner/CMakeLists.txt
  src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I08e2a109d8e37cbd77225129854e9e633725bfc7
2023-03-26 16:26:18 +02:00
Marcus Tillmanns
c6dc54b343 Terminal: Add Shell option menu
Change-Id: I08ea3c52ed28ab65f2dc902051bab9e6975e6a7e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-24 13:37:14 +00:00
Ali Kianian
1b82f7c164 QmlDesigner: Tweak the curve editor toolbar
* Less space is applied between the items
* Colors are modified

Task-number: QDS-9079
Change-Id: I5c9dbdf4ecdb518d509532a8e49c5eda098d760a
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2023-02-21 15:48:01 +00:00
Ali Kianian
a98c6583be QmlDesigner: Modify the style of slider for panelwidgets
Task-number: QDS-9134
Change-Id: Ie1a6ab94a546247e0cdd35798fc8085be005d13c
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2023-02-21 15:41:58 +00:00
Henning Gruendl
d105b20c7e QmlDesigner: Add pixel metric tool bar extension
Change-Id: I65f0ce65113f9d8b4af0ea95a914e2fd4fc2bb07
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-02-21 11:45:06 +00:00
Ali Kianian
c4cae904ee QmlDesigner: Style particle slider for new theme
The style for slider is overridden in ManhattanStyle.
SeekSlider is modified.

Task-number: QDS-9134
Change-Id: Ib96413f2bb7918d611adf4fc19c184efae1c4f4c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-02-17 10:57:10 +00:00
Ali Kianian
4108ba874a QmlDesigner: Tweak context menu design
- Margins are changed for the context menu.
- There should be more space between action text and shortcuts in
  the context menu.

Task-number: QDS-8969
Change-Id: I345b3197bb702c5704a8d91d65dcb7d96f2697b4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-02-01 07:51:50 +00:00
Thomas Hartmann
724eb54387 Add QDSTheme to theming and use it in ManhattanStyle
Change-Id: If3f634cd96665150b27605eaf7a2a5d4ea7078b6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-31 12:41:07 +00:00
Ali Kianian
757a6f2e12 QmlDesigner: Handle QmlEditorMenu in Manhattan style
* QmlEditorMenu is handled in Manhattan style.
* Icons are available for cascading menu items in macOS.
* Shortkeys hints are handled and right aligned in the menu.
* The style is customized  QmlEditorMenu.

Task-number: QDS-8720
Change-Id: Iff5ebae0dce70dade5b48a1abe4232e70d6953d6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-01-26 14:33:07 +00:00
Eike Ziller
2688a9629c Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/libs/utils/pathchooser.cpp
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I7ae3f91618c4a4ccb088679caea72b2a81590960
2023-01-13 09:16:25 +01:00
Eike Ziller
394caa1fee Allow combo box scroll wheel when pressing Ctrl
Wheel scrolling was disabled for combo boxes in Qt Creator 9, because it
created more issues than it solved. Instead of completely disabling it,
allow wheel scrolling when simultaneously holding Ctrl.

Fixes: QTCREATORBUG-28578
Change-Id: I08bccf039b60035bf425fac95b6af6fad349f43a
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-11 13:11:27 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Eike Ziller
373200accf Fix double * for long names of changed documents
We used to elide the right part of the name, and needed to take care of
not eliding the * away in that case. Now we elide in the middle, and in
that case the * may not be added to the elided text again.

Change-Id: I646b51d315e141a65df67841e163826e7136c118
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-23 10:17:25 +00:00
Tasuku Suzuki
95edda95b4 Set ElideMiddle for the editor combobox
When Qt Creator opens more than one file with same name,
the path to be shown tend to long.
In this case last part (file name) is as important as first part.

paths in Locator and Open Document are elided in the middle of path
already.

Change-Id: I953a8068b50331f9ef20ad9efbd947b4dbcf0845
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-26 17:33:21 +00:00
Tasuku Suzuki
f160b50bda QComboBox: not accept wheel events for changing values
It is dangerous for combo boxes within scroll views especially.

Fixes: QTCREATORBUG-28103
Change-Id: Ibed498658ce9d6f5b90f6d7e8ec7c4f2bbd015aa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-08-26 13:08:53 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Kai Uwe Broulik
b748f531ee ManhattanStyle: Check widget being not null
In case someone calls styleHint(SH_Widget_Animation_Duration)
without a widget.

Change-Id: If331f2365050b18fd6b06ce764c9ccbc7eede08a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-27 08:47:02 +00:00
Robert Löhning
38cdbd2bcd ManhattanStyle: Avoid crash when zooming invalid image
Task-number: QTBUG-101581
Change-Id: I4070efe266fbbd579b021cd9c03465c85313e042
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-11 11:48:02 +00:00
Alessandro Portale
c099f622bb Core: Allow dialogs and popups be styled as "panelwidgets"
A recent change that prevented popups from being styled as "panelwidget"
unintentionally removed the styling from the upper part of the mini
target chooser.

This change re-allows styling contents of popups (and dialogs) if they
have the "panelwidget" property set to true.

Amends: 0786e967dd

Fixes: QTCREATORBUG-26403
Change-Id: Ib85b06d0a2823a5caf736d1354cf025a6ddd475c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-14 13:13:54 +00:00
Alessandro Portale
0786e967dd Core: Prevent contents of Popups being styled as "panelwidgets"
Content of widgets with windowType Qt::Dialog was already excluded from
being styled as "panelwidgets". This change adds Qt::Popup to the
blacklist.

Task-number: QTCREATORBUG-26370
Change-Id: I76d07da4d8f3ae9f1c8235cdc072a04917454065
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-07 16:06:07 +00:00
Alessandro Portale
0369dc9977 Apply ManhattanStyle to QCheckBox on a toolbar
And consolidate the palette setting code for QLabel, QSpinBox and
QCheckBox.

Change-Id: If0dea048e2341bcbb35c52eb394d4d01efef88be
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-28 13:52:57 +00:00
Tasuku Suzuki
9c97e03465 Apply ManhattanStyle to QSpinBox on a toolbar
Up/Down arrows are not property styled.

Change-Id: I4bc633ec18e31d167f93f80fc241a20d0a7e2958
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-28 06:30:49 +00:00
Alessandro Portale
716f0bd032 Avoid compiler warnings about truncation from double to float
They appeared when compiling against Qt 6

Change-Id: I6bb94168f9776a7fa416d51ff4bb3ca32c9f02fc
Reviewed-by: hjk <hjk@qt.io>
2021-07-09 15:25:44 +00:00
Ahmad Samir
8ef025f732 ManhattanStyle: ensure text isn't cut-off in some UI elements
navigationWidgetHeight() is used in various places to calculate the
height of UI widgets that display text, e.g. the line-edits in the
search bar, hardconding a value results in the text being cut-off if
bigger fonts are used; fix the issue by using the higher value of
navigationWidgetHeight() and fontMetrics().height(), this ensures
widgets will accommodate the text.

Fixes: QTCREATORBUG-24535
Change-Id: I83ca7885840a75e05e913f7ecc77a60e61f8ef9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-14 11:09:22 +00:00
Alessandro Portale
3e9385bf1b Core: Make member functions const/static
readability-make-member-function-const finds lots of member functions
that could be made const. This change just picks getter functions that
really should be const.

readability-convert-member-functions-to-static finds non-static member
functions which do not access this. This change turns most of them
into static ones, but leaves some non static to keep the class API
consistent.

Change-Id: I004d6f7fab4375f9902f940f29b4a4f561fc7604
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-11 08:28:25 +00:00
Thomas Hartmann
9939b1844d Fix crash in ManhattanStyle
The widget can be a nullptr.

const bool isComboBox = widget->inherits("QComboBox");
Was crashing in the iso icon browser.

Task-number: QDS-3079
Change-Id: Ie7efa08ff5be094b94a835db895929158918bfcf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-11-25 13:17:15 +00:00
Alessandro Portale
dca5cb4f14 Don't animate TreeView expansions
Some styles set a QStyle::SH_Widget_Animation_Duration. An animation
does not go well with just-in-time population of the expanded content.
This change avoids that for all TreeViews.

Fixes: QTCREATORBUG-24834
Change-Id: I16ca4c61733d8875e713d7349ed6b99ba37ecf74
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-11-02 09:28:49 +00:00
Alessandro Portale
a8e704bd82 ManhattanStyle: Improve dark theme look of some widgets
This improves the visibility of radiobuttons, checkboxes, lineedits,
groupboxes, frames and tab-close indicator in dark themes.

Scrollbars, spinboxes and the arrow button of an editable combobox are
not handled by this change.

Task-number: QTCREATORBUG-23505
Change-Id: Ieba94f3847a3c2e0da7e9b554e1026525618f49f
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-10-09 08:25:10 +00:00
Friedemann Kleint
b8ad0fdae9 Fix QPainterPath-related compilation errors in Qt 5.15
Some include of QPainterPath was removed in Qt, causing errors like:

easingpane\easinggraph.cpp(258): error C2079: 'path' uses undefined class 'QPainterPath'
easingpane\easinggraph.cpp(275): error C2027: use of undefined type 'QPainterPath'
easingpane\easinggraph.cpp(305): error C2664: 'void QPainter::drawPath(const QPainterPath &)': cannot convert argument 1 from 'int'
to 'const QPainterPath &'
easingpane\easinggraph.cpp(305): note: Reason: cannot convert from 'int' to 'const QPainterPath'
easingpane\easinggraph.cpp(305): note: use of undefined type 'QPainterPath'
...

Add the missing include statements.

Change-Id: I4f3383cbcec891a52480a683c9c76ed5deee2b2a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-12 09:47:02 +00:00
Eike Ziller
3992e3c113 macOS: Fix label color in tool buttons
For example the "Ignore Whitespace" button in the diff viewer

Change-Id: I9882b9d2f3e22635bfbb047904ef284dd515db9f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-03-11 06:10:04 +00:00
Alessandro Portale
8d722587b9 Core: Use themed color for "highlightWidget" in ManhattanStyle
Change-Id: I0bd594fec2a0fe9b3093d7c6a4439657c78dfff6
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-01-24 13:45:13 +00:00
Alessandro Portale
27a5d50125 ManhattanStyle: Fix themed drawing of toolbar extension
The extension image gets queried via QStyle::standardIcon() instead of
QStyle::standardPixmap(). That's why so far our extension was never
drawn with our own icon.

The icon .png needed to be resized in order not to be resampled in @2x
mode.

Change-Id: I27ae4e5872c18421e5d40271b01cb9daf8adc8bc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-12-10 13:34:39 +00:00
Nikolai Kosjar
eabc5e2bdd Core: Simplify
bugprone-branch-clone
readability-simplify-boolean-expr

Change-Id: I294133af65f68c3b9fc1f4c6fb0b93b9ff179a6e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-11-01 09:09:47 +00:00
Sona Kurazyan
82bcf4e9f5 Remove usages of deprecated APIs
Replaced:
  QPalette::ColorRole::Background -> QPalette::ColorRole::Window
  QPalette::ColorRole::Foreground -> QPalette::ColorRole::WindowText
  Qt::ItemDataRole::TextColorRole -> Qt::ItemDataRole::ForegroundRole
  QFontMetrics::width() -> QFontMetrics::horizontalAdvance()

Task-number: QTBUG-76491
Change-Id: I1302e6b569e725daa6f7be1428ffe055657fc644
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-03 09:15:30 +00:00
Eike Ziller
86b5391086 Merge remote-tracking branch 'origin/4.9'
Change-Id: I57c5c1ce5c4a86815a84b95ddc826a981afdb673
2019-03-27 11:42:04 +01:00
Eike Ziller
8ff29ff19d Windows: Fix submenu arrow style
Since dccf5a5ae7 the submenus have the
parent menu as an actual parent widget. That makes ManhattanStyle handle
them differently, because they are now children of the menu bar, and
therefore considered "panel widgets" to be styled.

An undesired side-effect is that ManhattanStyle decides to style the
submenu arrows itself then.

The patch makes ManhattanStyle not style arrows if they are painted as
part of a menu.

Fixes: QTCREATORBUG-21376
Change-Id: Ia5556c7327c3f0c2f21cadc86047bec785da27df
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2019-03-26 07:50:47 +00:00
Friedemann Kleint
ec6b38dea0 Fix Qt 5.13 deprecation warning about QFontMetrics::width()
Replace by QFontMetrics::horizontalAdvance(), fixing:
warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated:
 Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]

Change-Id: I9991ffefe6e87e872dc35ba291d562e06b28ca64
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-02-15 15:12:02 +00:00
Alessandro Portale
f36f04deba Core: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init (partially)

Change-Id: Idf10d7ffb1d98a04edc09a25c35e4e9e3abe87b5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-08-08 16:04:21 +00:00
Alessandro Portale
b960448887 Core: Fix QComboBox in StyledBar in lightColored mode
Making sure that the text color in the combobox adapts to the background
color in lightColored mode.

Change-Id: I63ffbecde30be837540c0d4a1074ccbcbd31c756
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-14 15:47:27 +00:00
Montel Laurent
f18ae4ff6f Don't use return keyword when not necessary
Change-Id: I4b9fad1eee60e942ddbccda53a4af27e978df498
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-14 11:02:14 +00:00
Oleg Yadrov
4fac31015f ManhattanStyle: remove QTabBar position adjustment
QTabBar style was recently updated in QMacStyle (see 175f33ed855b0).
New macOS style requires all tabs to be moved one pixel to the left, so
there's 1 pixel separator line visible between them which is always
left border of the tab with higher index. But once you start moving
a tab, you'll notice that each tab has both left and right borders.

ManhattanStyle is a proxy style what means it falls back on some other
style which can be either platform-specific ("Flat" is an example) or
cross-platform ("Dark" is based on QFusionStyle). Now, even though
ManhattanStyle does not implement a custom look of QTabBar, it does
this 1 pixel adjustment for the very first tab
(QStyleOptionTab::Beginning) and QStyleOptionTab::OnlyOneTab no matter
what style is actually used.

Unfortunately, QStyleOptionTab::TabPosition enumeration does not have a
specific value for the tab which is being moved, so it's painted as
OnlyOneTab. As a result of this additional adjustment left border of the
moving tab goes out of pixmap's geometry on macOS and it looks like it
does not have left border.

This is not right to modify QTabBar's geometry for any theme arguing
it as "otherwise it looks bad" because in general case this statement is
wrong: even Fusion style draws 2 pixel wide line on the left of each
tab. Proper solution would be to implement a custom look of QTabBar in
ManhattanStyle.

Change-Id: I9e110f3195d068c6101c412e142d3a1ff7e80852
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-03-16 16:49:21 +00:00
Orgad Shaneh
a6427453f4 Fix icons that moved from core to utils
Change-Id: Id3151b1cce2d97b2bfb6debaf3cebe53cd6d88ed
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-10-27 16:12:35 +00:00
Alessandro Portale
6526e28bd0 Core: Fix some Classic theme regressions
Commit 15fbfaf2e9 moved many images into
utils, but some paths in the source were not adjusted accordingly.

Change-Id: I6d32754c41455271c0bfcedf0777a38fbeca67ab
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-10-07 13:20:25 +00:00
Ulf Hermann
15fbfaf2e9 Move icons to Utils
This way we can use them from libraries, not only from plugins.

Change-Id: Ic35cfd5f04d638d87606bf272b2c00ded1267c1b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-05 10:52:53 +00:00
Alessandro Portale
276b20409d Themes: Lighter toolbar borders
The toolbar border/separator lines for flat themes need to be a bit
lighter.

This change introduces StyleHelper::toolBarBorderColor and puts it into
use for drawing all toolbar borders.

Change-Id: Icef20759ce282e768f6ba867474e506b9230b864
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-07-21 10:17:05 +00:00
Alessandro Portale
a0f1e716c7 Themes: Draw optional toolbar borders
We need a new Theme flag for that. And it will initially only be set for
the flat light theme.

Task-number: QTCREATORBUG-16633
Change-Id: Id723e128364eb6186fe8e28e2087a3698b1bf632
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-07-19 16:42:35 +00:00