Commit Graph

193 Commits

Author SHA1 Message Date
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
Alessandro Portale
794d901c30 Core: Draw the separator also under a menu with "FlatMenuBar" flag
That separator under the Menu is drawn in the Classic and Flat themes.

This change ensures that it is also drawn for themes with "FlatMenuBar".
The "Flat Dark" and "Flat Light" need it.

Change-Id: I43c932cfc4634330a08f86a33c9d74555e420a2a
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-07-05 07:32:48 +00:00
Alessandro Portale
8588cf268f Utils: Replace Theme::widgetStyle with a flag
Theme::widgetStyle with its two possible return values makes less sense
than a bool flag. Especially since we already have several separate
theme flags for ui elements which might be "flat" or not.

Change-Id: Ic521bb58c04386b735b784079de05e521bc1f45f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-06-21 15:24:58 +00:00
Alessandro Portale
3b30617758 Core: Improved theme-awareness in application menu painting
Using theme colors rather than hard-coded ones and at the same some
simplification.

This is needed for an upcoming "Flat Light" theme.

Change-Id: I8a8715a16d1b246c5228978633143eb64d371701
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-06-21 15:24:15 +00:00
Alessandro Portale
d7f8af9392 FancyLineEdit: Visualize the disabled state
The painting code path for flat themes did not handle the disabled
state. This change catches up on that, and also suppresses the painting
of the hover border in disabled state.

Change-Id: I29d50be4549c81a25f976c61f6d4541862d2925e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-04-29 12:57:23 +00:00
Alessandro Portale
250c77a9a3 Style: Set PM_SmallIconSize to 16x16
Avoiding scalining of icons in menus.

Change-Id: Ie855075dbc6edf09b71894bff7b0c33ba6c03517
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-21 15:11:45 +00:00
Alessandro Portale
397ebcac92 Debugger: Enabled state of "Threads:" label depends on thread combobox
...and making sure that items of a disabled combobox are visibly
disabled.

This prevents users from clicking on the Threads label before debugging
even started.

Change-Id: I59cc9b7e875fe8c126a9ee4221ff9d8322e4b1a8
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-18 11:25:37 +00:00
Alessandro Portale
adc3084b0a ManhattanStyle: HighDPI fix for ToolButton with menu
Off-by-1.5

Change-Id: I300b2ff66622443b2b20ddb49a9038417ad4d074
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-04-07 14:38:05 +00:00
Alessandro Portale
3e1c7f6fd5 Flat themes: remove the shadow from pressed manhattan toolbuttons
That's flatter and more consistent with the flat pressed buttons in the
mode bar and status bar.

Change-Id: I29edd2b184b8468005bffe8fe8c9f2e275355df1
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-04-02 18:25:15 +00:00
Alessandro Portale
2710168446 ManhattanStyle: Themable arrows
This change makes arrows in e.g. ComboBoxes themable. This also improves
the clear distinction between enabled and disabled state.

Change-Id: If40dcd3e162ad71d1bc6507c047203aa60e09ee6
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-03-31 10:40:32 +00:00
Alessandro Portale
063c8d45c8 Theming: Fix menu item highlight for the themed (flat) menu bar
Since StyleHelper::baseColor now returns a themed color and
QColor::lighter() lightens up dark colors relatively little, we should
to use a themed color for the background instead.

Task-number: QTCREATORBUG-15930
Change-Id: I256ddcf946a14af6937c324a76e3f3a24919ae3b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-03-30 07:19:12 +00:00
Alessandro Portale
ddde4bdd27 Utils: Improved handling of StyleHelper::baseColor
This change makes sure that the "UI coloring" feature respects the
original brightness of the current theme. It prevents dark themes from
getting a too light recoloring and vice versa.

Extra benefit: this allows to remove much recently introduced code.

Change-Id: Ib2c96e7ed172a4cc97520aa4b5d180cc6353c661
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-03-21 14:23:23 +00:00
Alessandro Portale
49525a11f4 Flat themes: enable recoloring of the status bar & progress
The flat OutputPaneToggleButton now has the same hover and selected
colors as the sidebar items and toolbar items. This changes the
appearance in the dark theme a bit, and I hope in a good way.

Change-Id: I52826c6d1c4539f799c74580f195a95609ea0416
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-03-16 14:49:13 +00:00
Alessandro Portale
04a68518c9 Themes: Make theming of the menu bar optional
Inspired by numerous user feedback, I want to turn off the theming of
the menu bar for the new flat theme, and make it look like in the
default theme. At the same time, I want to leave the "dark" theme as it
currently is.

This patch adds a theme flag FlatMenuBar and turns it off for the new
theme.

Change-Id: I9bba056a27fab7a634b45324e3fe8cd26f50df74
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-14 11:00:44 +00:00