Commit Graph

127 Commits

Author SHA1 Message Date
Alessandro Portale
dbfc2a3242 Core: Use LayoutBuilder for FancyTabWidget
Change-Id: I01905732563807715eec21879e5a1c8c6fc2b5fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-07-11 09:12:13 +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
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47: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
Jarek Kobus
0dae822ca3 Drop Qt5: Core: Get rid of QOverload
Change-Id: Ibaebd83304680156e13a9ebc473075ad2a4bfed4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-20 10:30:34 +00:00
hjk
802de0eb5e Utils: Collapse most of porting,h
Taking the Qt 6 branches, leaving some dummies until downstream
adapted.

Change-Id: Ib9b86568d73c341c8f740ba497c3cbfab830d8a1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-13 09:44:09 +00:00
Eike Ziller
e84bc5f81f Modes: Temporarily re-add a removeMode function
Partially reverts 6a142dfd95

Looks like this was used by 3rdparty plugin(s) for a mode that is only
useful for some time and then should not be shown again.

Re-add removeMode from before 5.0, but do not trigger that automatically
from the mode destructor, so it doesn't interfere at shutdown.

This patch is just a binary compatible partial revert. Since removeMode
is broken in several aspects (e.g. corresponding commands are not
removed) and we don't really support adding and removing modes during
runtime, this should be replaced later on by a different way to handle
the usecase, like a "visible" property for modes, which could be useful
in other ways too.

Fixes: QTCREATORBUG-26270
Change-Id: Ief2a36d94bd09b0511a14f528b33fdbcc4c4222b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-09-24 06:45:28 +00:00
Jarek Kobus
6a142dfd95 Fix the "Cannot remove a null widget" warning
After the 867c0b8d8a53974074b1fff5b132f3ae9f150066 got integrated
into qtbase, Qt started issuing a warning on Creator shutdown.
The reason is that mode's widget might be deleted before the
mode's destruction. Deleting the mode's widget removes it automatically
from the contained stacked layout of the mode manager. This
means that the indices inside the stacked layout and those inside
the ModeManager's d->m_modes list are now out of sync.
FancyTabWidget::removeTab() can't find the right widget for the
passed index now or returns wrong widget for it.

The fix is to remove removeMode() method (and in turn some more
unused now). The context objects don't need to be removed on
shutdown, and the remaining mode's widgets will be deleted
by Qt itself when the main windows is destroyed.

Fixes: QTCREATORBUG-25925
Change-Id: I70c2773eea2984c5d06ce3bf71a4271b267efbe0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-30 11:41:34 +00:00
Jarek Kobus
be1d33299e Use invokeMethod instead of single shot timer with 0 timeout
Refactor it in coreplugin.

Change-Id: I6aaad1b9270a8ff8a4a0bea6a1fff806b2fe190b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-29 15:24:41 +00:00
Alessandro Portale
a3857a996a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Amends: b2a766a79a

Round #2: This time done with Qt Creator's Analyzer, which
found other occurences than run-clang-tidy.py

Change-Id: I479e280c7abcf2d24baccbb0af69ae4bda05198e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-27 13:26:07 +00:00
Alessandro Portale
af0e135e73 Utils: Improve InfoBar border
Replace 80s 3d frame with a slim separator line.

Task-number: QTCREATORBUG-23176
Change-Id: If50d35f500323bf4b963cb2222b5f947a307a5bc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-19 10:44:44 +00:00
Eike Ziller
929e3819a8 Qt6: enterEvent now gets passed a QEnterEvent
Add a Utils::EnterEvent for porting.

Task-number: QTCREATORBUG-24098
Change-Id: I2782fe33e41a813b5562676f6dc87d6d53babdd3
Reviewed-by: hjk <hjk@qt.io>
2020-09-29 10:34:22 +00:00
hjk
2d78bd4b19 Some Qt6 porting
- new ambiguous overloads for mapToGlobal
- some functions now return qsizetype instead of int

Task-number: QTCREATORBUG-24098
Change-Id: I0020e5689e093653e9e0e6f0d6263720bc2e003b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-22 10:22:56 +00:00
Eike Ziller
0eefc5b70d Add a menu to Debug mode that switches perspectives
Set a menu for switching perspectives on the debug mode icon. When icons
& text are shown for the modes, there is an additional arrow to the
right of the mode that can be clicked to open the menu. This
functionality was added in 4.1 for that purpose, finally use it.
Do not show and arrow in "Icons Only" mode, so it stays small, but make
it available on right-click as well.

Change-Id: If19877b5231b7f01f0b3fd98cf65e8eaf9da1a5f
Reviewed-by: hjk <hjk@qt.io>
2020-06-17 06:48:17 +00:00
Sona Kurazyan
8e31932c29 Remove usages of deprecated APIs of QLayout
Replaced:
  QLayout::setMargin() -> QLayout::setContentsMargins()
  QLayout::margin() -> QLayout::getContentsMargins()

Task-number: QTBUG-76491
Change-Id: If28ef6910b3afe5d04e4746b74f9362a3e3b3c8e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-02 13:01:07 +00:00
Eike Ziller
c67ed4d35b Add global notification area and use for UI Tour info
Adds a global info bar display above the main window's status bar that
can be accessed via ICore::infoBar().

Replace the blocking "Take UI Tour" dialog by a notification there.

Fixes: QTCREATORBUG-22819
Change-Id: I733f1bfd2d1db0295754ed2e28bb202f927d0edb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-08-12 07:15:27 +00:00
Orgad Shaneh
39ba01da71 Merge remote-tracking branch 'origin/4.9'
Change-Id: I7d1912cd5c4d824fd40d3454c5f1bb796f2c21d8
2019-04-07 23:13:17 +03:00
Eike Ziller
56ca042ddc Mode selector: Suppress change signals when clicking on active mode tab
Change-Id: I027b1a293fb6daafbdd8fee28fa0f477e0be8367
Reviewed-by: hjk <hjk@qt.io>
2019-04-05 07:37:57 +00:00
Eike Ziller
9ead3b6289 Fix missing mode changed signal on startup
Reverts commit 88fc878aa8
and fixes the original issue differently.
Introduce a currentAboutToChange signal in FancyTabBar that
is passed on via FancyTabWidget to
ModeManager::currentModeAboutToChange.
This avoids the temporary mismatch of selected indices in the
tab bar vs tab widget.

Change-Id: If1a331db5478450d7c57e5908b2bed218e9828a8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-04-03 10:50:09 +00:00
Eike Ziller
b5e7522237 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/pythoneditor/pythoneditorplugin.cpp

Change-Id: I9a95df5e16b34538539ced7dfc5d326b700794e6
2019-04-02 12:22:48 +02:00
hjk
88fc878aa8 Core: Use mode stack index for FancyTabWidget::index()
This way, currentIndex() is the right one during
currentModeAboutToChange() execution.

Change-Id: Ibe6282b6266aef8b4a536855ff01f2016cc25f43
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-03-27 12:17:51 +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
Aaron Barany
569e498c4d FancyTabWidget: Add mode highlight for icon only setting
Change-Id: Ie7319c95ce437ef0118ea5c1617f703f81479f8d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-01-12 21:00:10 +00:00
Aaron Barany
9eb4df7a1f Editor: Improve icon/panel selection colors
Improve the visibility and clarity for the output panel and selected icons
for dark and creator themes. This should make it easier to tell what item
is selected across each of these themes.

Task-number: QTCREATORBUG-18888
Change-Id: I4cf4203a0d5b46978d32810cc81dfcdb5ac8b3ef
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-01-12 20:59:36 +00:00
Aaron Barany
aa30b3e854 FancyTabWidget: Add a highlight to the selected mode icon
Change-Id: I3276f22ba11182cadac4748e86724021348f99f7
Reviewed-by: Aaron Barany <akb825@gmail.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-01-12 13:15:13 +00:00
Eike Ziller
31d8ad53f8 Mode selector: Restrict background painting to selection widget
The FancyTabWidget is spanning the whole window, but only the bar with
the mode buttons and tool buttons should get the background painted.
This fixes that e.g. the titles and labels in the debug mode were dark
instead of having the usual widget background color.

Fix-up of 8770d83fc8

Change-Id: I9cccb014fd296b9277b675e09a94149b8538a3f1
Reviewed-by: hjk <hjk@qt.io>
2018-12-20 13:41:55 +00:00
Eike Ziller
8770d83fc8 Add general UI introduction
Adds a Help > UI Introduction, which highlights basic aspects of the Qt
Creator UI.

The pages to show are defined in a format that can later move into a
text based configuration file like JSON. It specifies an optional object
name of a widget to highlight, a title, a brief description and a longer
description (potentially with tables, lists and other simple HTML).

Fixes: QTCREATORBUG-21585
Change-Id: Idb64c87e1d752bc24437588278093a96be0eeddb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-12-18 09:53:36 +00:00
Orgad Shaneh
64b8f98a35 FancyTabWidget: Set focus on widget change
If the locator popup is open, and the user changes mode using the keyboard
(Ctrl+num), the popup was not closed.

Change-Id: I7d5cb93229715dd293b6eb4d36cf2a9cb4467123
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-26 08:52:37 +00:00
Alessandro Portale
ac0db4dc3b Core: Fix icon size calculation in the mode bar (Icon + text mode)
This amends 768f0a6209 . The order of
setting a painter font and using the fontmetrics of the painter font got
swapped, and therefore the size calculations were done with a wrong
font.

Task-number: QTCREATORBUG-20404
Change-Id: I98d1fbbbf467ded1dc0288784036595976b46e10
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-29 14:37:40 +00:00
Alessandro Portale
768f0a6209 Core: Icon-only option for the mode selection bar
This adds an icon-only mode to the mode selection bar (and action bar).
A newly introduced Action can cycle between icon+text, icon-only and
hidden.
Also, the "Window" Application menu gets a submenu with the three
styles.

Task-number: QTCREATORBUG-18845
Change-Id: I4e0c453f6d920dfbfd795b8b054f6ff392a8700a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-09 06:00:27 +00:00
Orgad Shaneh
7d3a79c696 Utils: Purge asConst
Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:00 +00:00
Alessandro Portale
84e17dd0f8 Core: Modernize FancyToolButton and FancyTabWidget
I got much help from clang-tidy, clazy and clang-format.

In preparation of QTCREATORBUG-18845

Change-Id: Ie881efd5093d86dc8a345e0a5badd93a6ccecbb9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-21 14:58:46 +00:00
Alessandro Portale
5e89fae10f Unify the dimensions for all mode/action bar icons
Having icons of all different kinds of sizes makes it difficult to get
the painting right in all cases. It definitely fails when the szsytem is
running in multi-monitor mode with different scaling factors. Unifying
the dimensions makes it possible.

This change should not cause any visual difference in a purely scaled or
unscaled screen.

Task-number: QTCREATORBUG-18869
Change-Id: I3a864c9a86036b4f4f3b350a489077b247ca85b7
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-09-19 13:54:30 +00:00
Alessandro Portale
b3911628cf Core: Clean up some ancient, unused code in FancyTabWidget
Change-Id: I4b24522028c8184f39bd05d54644fee0fba3b434
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-09-06 08:55:59 +00:00
Friedemann Kleint
ce088cb754 Call QPainter::end() prior to QPixmapCache::insert()
Inserting a QPixmap with active painters on it causes it to
do a deep copy of it, which is unnecessary.

Task-number: QTBUG-58653
Change-Id: I49123ffcec2e12a01c87974b7a513d68a11185d4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-02-08 11:33:01 +00:00
Ulf Hermann
e440e344ca FancyTabWidget: Skip setCurrentIndex if the index doesn't change
There is no need to update() and signal currentChanged() then. It will
just incur unnecessary overhead. Also, only check for isTabEnabled()
once.

Change-Id: I59bde7d99f953ef6af89d3197a81d1acaae381f5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-23 08:59:42 +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
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
Eike Ziller
685bc2cca1 Support modes with context menus.
If modes provide a QMenu, a little arrow is shown next to the mode icon.
If the user clicks there, the menu is shown instead of changing the
mode.

Limitations: Modes need to provide some QMenu instance already when they
are added to the object pool. Setting or removing the menu later will
not update the UI.

Change-Id: Ic4ef709e6200afcff14f41054a5dd98c37b0b849
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-05-27 09:24:02 +00:00
Alessandro Portale
0235412b34 FancyTabWidget: Ensure a separator between colorbutton and tabbar
Some Themes do not want highlights and shadows in the toolbars. But we
definitely want a separator between FancyColorButton and FancyTabBar.

Change-Id: I24f384514146d664dbb41ef073368a11c79d85b8
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-04-11 10:05:25 +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
Eike Ziller
a029aafdf0 Move handling of color dialog that is opened from mode selector
It doesn't really make sense to have that handling deep in the
FancyTabWidget.

Change-Id: If4b4b9b9c3cbc49c25091982b398fb18f9bf87c2
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-03-18 12:59:36 +00:00
Alessandro Portale
bc481dc399 Flat theme: Same disabled color all side/tool/status bar icons
And adapting darkframe.creatortheme accordingly to match Diana's
specification

Change-Id: I9e1f62869ff91d7cfd3a26f51d26225d549a0965
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-03-17 11:54:14 +00:00
Alessandro Portale
d36716ae14 Themes: Fix UI recoloring for flat themes
Reduce the usage of half-transparent colors to just the Fancy* widgets.
Otherwise, we have side effects like QTCREATORBUG-15770 in other
widgets (e.g. search results pane).

Change-Id: I0e2b0155441c4f1a071bd3c1029577accb73d56b
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-26 11:54:13 +00:00
Alessandro Portale
02af5d80b6 Themes: Enable UI recoloring for flat themes
Change-Id: I1907c42a769124b7505bd7afaf6c4da910f3f407
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-18 11:37:28 +00:00
Orgad Shaneh
5646480f27 Core: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I2dde14919d917816d02117338205f8f861d8af0a
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-03 07:54:02 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Alessandro Portale
37c1823974 Flat and themeable side bar icons
This patch adds flat side bar icons according to
http://blog.qt.io/blog/author/didesous/

The flat icons are supposed to be opt-in, via the theme flag
"FlatSideBarIcons=true". It is false by default for the default
theme for now.

Change-Id: I1cbe69d4e138d5d23c0172a374933ac7a4ce8a5b
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-12-03 11:30:50 +00:00
Alessandro Portale
beac7dcb99 HighDPI fixes
ColorTip:
Draw the border around the color tooltip properly.

MiniProjectTargetSelector:
Fixing a few misplaced outlines

FancyActionBar:
Fixing a few misplaced outlines, also:
- deduplicate hover gradient painting code
- use pixmapcache for the hover gradient
- only draw the hover gradient if the tab is hovered
- use 0-255 as range for fading value

QtQuick Designer:
HighDPI form editor icons, and removing some since a
while unused icons.

ProjectExplorer Mode:
HighDPI graphics and fixing a few misplaced outlines

Task-number: QTCREATORBUG-15222
Change-Id: I4fcf515014317791499ad89bf6ef88d961e4b752
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-11-10 19:52:17 +00:00