Commit Graph

174 Commits

Author SHA1 Message Date
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Alessandro Portale
42b5aa4aca Target selector: Fix drawing of the run icon
With the new layout calculations (see QTCREATORBUG-24148), the
option rect can now be used to center the icon with the provided
functions in QRect.
The current code kind of works if RunColumnWidth matches the row height,
so that it can do things like subtracting vertical from horizontal
dimensions. But in fact, the icon is not centered on the option.rect.

fillRect(option.rect, Qt::red) <-to verify.

Apart from that it has a few more downsides.

This change:
- Uses the run icon made for dark background
- Paints the icon at its native 16x16px (instead of 15x15px)
- Uses QRect::center()/moveCenter() to actually center the icon

Change-Id: Ib280c650bd454b551f9e30ca108579fee06d81f0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-30 20:49:09 +00:00
Christian Kandeler
66d74ac566 Target selector: Make sure the run icon is not hidden under scrollbar
Fixes: QTCREATORBUG-24148
Change-Id: Icae939d8f63a99b372f32d91d33acdfb2130a4f7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-30 09:03:45 +00:00
Eike Ziller
995ba78fae Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/tealeafreader.cpp
	src/plugins/cmakeprojectmanager/tealeafreader.h
	src/plugins/projectexplorer/miniprojecttargetselector.cpp

Change-Id: I88d85be3903f57a55fddb7901e771a4822db1b85
2020-03-04 08:15:50 +01:00
hjk
6164378372 ProjectExplorer: Replace a few foreach()
Change-Id: I445cdfaac13ac894be3cd6fc8c20b4a09f460a01
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-02 11:54:00 +00:00
hjk
7f1c8aea5d ProjectExplorer: Make communication between target and selector direct
Architecture-wise, this now means that Target knows about the
MiniProjectTargetSelector, otoh, Project does less, and quite
a bit of signal, slot and qobject_cast is gone.

Change-Id: I0feef9328144282c7c4ca710a12ac0e495810684
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-20 11:45:48 +00:00
Christian Kandeler
72d83fddf2 MiniProjectTargetSelector: Merge two pairs of classes
Change-Id: I7b6e1c603da2c6457e150fcb5f60c11a844b2f34
Reviewed-by: hjk <hjk@qt.io>
2020-02-20 09:12:23 +00:00
Christian Kandeler
b05105bd34 Allow starting a run config from the MiniProjectTargetSelector
For non-trivial projects, this provides a much faster way to start a
non-active run configuration than going via the project tree.

Fixes: QTCREATORBUG-21799
Change-Id: I0078d905dbd8a3a417920584c9f3bb9742cb4756
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-21 13:50:25 +00:00
Christian Kandeler
2a7d77d346 MiniProjectTargetSelector: Use Utils::TreeView
... instead of QListWidget.
This is needed for a follow-up change. Also, it's less code.

Change-Id: I2222b7c9c7c3ea0a493dc72fde7e4308353c327f
Reviewed-by: hjk <hjk@qt.io>
2020-01-16 09:00:42 +00:00
Christian Kandeler
71eff7c815 MiniProjectTargetSelector: Move internal classes out of header file
Preparation for upcoming refactoring.

Change-Id: Id3fcafa776efd3de02bc5b08234e8b37cf5fe417
Reviewed-by: hjk <hjk@qt.io>
2020-01-14 17:05:46 +00:00
Alessandro Portale
4bc38f1101 ProjectListWidget: Improve MiniProjectTargetSelector theming
In order to support theme tinting, Use Utils::StyleHelper().baseColor()
instead of MiniProjectTargetSelectorBackgroundColor and
MiniProjectTargetSelectorSummaryBackgroundColor roles. Also QPalette
instead of a style sheet.

The above two theming roles are marked for deprecation.

Change-Id: Ia9688a617056adbf55c64373d08f9e15ecc5af1f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-12-20 15:46:13 +00:00
Alessandro Portale
6b38f0c47d ProjectExplorer: Fix theming of KitAreaWidget
Let the parent widget (MiniProjectTargetSelector) paint the background.
Remove all unneeded QStyle and QPalette setters.

(Note: select a kit with mutable device to see the fix)

Change-Id: I9166659580c3cb3047155ccea65c749d5d542f07
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-12-20 15:45:21 +00:00
Christian Kandeler
bc921261b1 ProjectExplorer: Close the target selector on a double click
Before this patch, users needed to click outside of the widget to close
it using the mouse, which was slightly annoying.

Fixes: QTCREATORBUG-21846
Change-Id: I051cde8e76cd2294f2888fb45904824a39653488
Reviewed-by: hjk <hjk@qt.io>
2019-12-11 15:02:16 +00:00
Laurent Montel
f467badc2f Port setMargins to setContentsMargins
Change-Id: Ie6b3f3e4dddbbf4bcc7ea7561ec348ff2c666907
Reviewed-by: hjk <hjk@qt.io>
2019-10-16 05:02:57 +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
hjk
eb06d1f1cc ProjectExplorer: Fix crash when triggering Kit name changes
Amends 7d3091a7b9.

Change-Id: Ibb18ffef49f8b9739121dcbfa29639d5e3f6a71b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-31 12:39:23 +00:00
hjk
7d3091a7b9 ProjectExplorer: Remove ProjectConfiguration base from Target
Targets are different from {Run,Build,Deployment}Configurations,
both regarding the level in the ProjectExplorer hierarchy, and
also by the set of supported operations (e.g. aspects).

Change-Id: Ia8490e2280a9ecc518395c5e48ce2fd5d6d58fd2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-31 11:18:16 +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
hjk
20798dfb57 ProjectExplorer: Code cosmetics
rename KitManager::kitInformation() to kitAspects, make it return
a const list to be able to use clutter-free ranged for. Polish
vicinity.

Change-Id: Ibe187586152eb0053efa8c571adbd73158f109c4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-12 13:54:26 +00:00
hjk
470ce8a856 ProjectExplorer: Move use of some knowledge from KitAspectWidget to KitAspect
Essentially a follow-up to 09a7d2bd45.

Change-Id: I4dd9d64eec77ddf9cdccbac808e9a0978b9986bf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-12 13:41:09 +00:00
Christian Kandeler
ce19540b77 Move KitAspectWidget definitions alongside their KitAspects
A KitAspectWidget class is tightly coupled with the respective
KitAspect, and no one else ever needs to see any KitAspectWidget
subclass at build time.

Change-Id: I1883af3b054c225e1ff5dd913118715bfdbaacfc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 14:39:29 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Kai Koehne
c1d6562d2e Do not mark html text for translation
Change-Id: I2a59c52553b39c437fbc58588032859d8257f87d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-12-17 11:41:44 +00:00
Alessandro Portale
8d19333075 ProjectExplorer: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default
modernize-use-transparent-functors

Change-Id: Iebed22caa2e733d292f334e956e3d16b844e14e3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-16 10:01:53 +00:00
Aaron Barany
95e0418e8e Editor: Improve visibility of some UI elements
Don't set the initial palette on the text color scheme dialog. For dark
themes this would cause the labels for the dialog to be black, which was
very difficult to read against the dark background.

Mini project selector now uses the highlighted text color for the item
that
has focus. This will work more correctly when dark themes use a more
readable selection color, which will be done next commit.

Task-number: QTCREATORBUG-18888
Change-Id: Ie666af0ce9f8a8030e5e83ccd9a4de362dccaa4f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-05-25 14:03:50 +00:00
Tobias Hunger
37b86c89d1 Utils: Introduce case friendly comparison function to stringutils
Use this operator in the miniprojecttargetselector as well as the
projectconfigurationmodel. This should unify the sorting of
build-/deploy- and runconfigurations in various places in Creator.

Task-number: QTCREATORBUG-20023
Change-Id: I7aed2ebcb9d65244395d68b7dc5da599d6503962
Reviewed-by: hjk <hjk@qt.io>
2018-03-13 15:22:20 +00:00
hjk
34d7b26a88 ProjectExplorer: Shield against null project
.. in MiniProjectTargetSelector::addedDeployConfiguration. Similar
was already present in  MiniProjectTargetSelector::addedRunConfiguration

Change-Id: Ie1c86a8e12bdbfd5c0beea58a1a41a2cbf3d52f2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-10-17 08:56:22 +00:00
Tobias Hunger
56086d6bb5 MiniProjectTargetSelector: Allow for startupProject to be nullptr
This should not happen, but currently it does during session loading.

Change-Id: Ic4da775010c8d947e8db210f618519080068e14a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-05 08:14:57 +00:00
Tobias Hunger
62b3f422c4 MiniProjectTargetSelector: Fix removal of BuildConfigurations
Task-number: QTCREATORBUG-19008
Change-Id: I8effc8739cb9cc7a347836fde8ae7a94a402ddb7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-04 12:26:03 +00:00
Tim Jenssen
c9f48f87e2 MiniProjectTargetSelector: Trigger less list updates
Change-Id: I39634ef201ac4a12d5ea114843c73e4558015c05
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-26 14:08:53 +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
Orgad Shaneh
139792ee25 Merge remote-tracking branch 'origin/4.4'
Change-Id: I9ab2c68d2bd07b0dd89051a2f5f6fa51676d8594
2017-08-30 01:24:11 +03:00
Nikita Baryshnikov
42a5446b6c MiniProjectTargetSelector: fix division by zero
Change-Id: I618c92366424e924d13841a36c4393057e8d9aa4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-08-27 06:55:44 +00:00
Tobias Hunger
bbb54cdeba MiniProjectTargetSelector: Use generic reporting of project configuration changes
Change-Id: I55a852db08ee5700acb7530769166b19fb12a670
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-01 10:21:25 +00:00
Tobias Hunger
0bfa2e80c9 MiniProjectTargetSelector: Fix includes
Change-Id: I057a0bf08bed470b412082a34029ccec03e32d28
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-25 14:29:15 +00:00
Tobias Hunger
ae95074b17 MiniProjectTargetSelector: Simplify code
Change-Id: Ie28efa6deb29801dd670656eeeeef81ccc4ae87f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-25 14:29:09 +00:00
Tobias Hunger
03f22b4bc1 ProjectExplorer: Enable tooltips in MiniProjectTargetSelector
Enable support for tooltips in MiniProjectTargetSelector. Use it to display
the kit information when hovering the Kit selection area.

Change-Id: Ie9691973cb74e25217635dc0a798dd9c6219ad37
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-08 10:41:57 +00:00
Tim Jenssen
f2b8e9acd1 SessionManager: Clean up methods around projects
Clean up methods around projects() and update its usages to modern
language standards.

Change-Id: Ia0a4574d014ce41e0d511a392e4eed4680981d0e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-02 09:31:23 +00:00
Orgad Shaneh
c01d7a7540 Merge remote-tracking branch 'origin/4.1'
Change-Id: Ieaddc6093d10c08a54acb9b57cbbfe022bc3c038
2016-09-22 11:01:16 +03:00
Orgad Shaneh
714a9315aa ProjectExplorer: Fix infinite loop in mini target selector
Change-Id: I454c1b6eb3361b2e610782585152243163acfd58
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-19 07:37:30 +00:00
Orgad Shaneh
1853f01a5b Merge remote-tracking branch 'origin/4.1'
Change-Id: Ia442f30f387fe9292217582260bbe79e54608810
2016-08-05 11:40:07 +02:00
Alessandro Portale
13ca2a3390 MiniProjectTargetSelector: remove dead code
Setting the palette does not seem to have any effect.
(May be due to the applied stylesheets overriding everything)

Change-Id: I27fd8395274009dbe83a0bde3fc3ac68fc16a435
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-08-04 14:46:19 +00:00
Orgad Shaneh
feb3d6a864 ProjectExplorer: Load images lazily in mini target selector
Change-Id: Ifbaca8dc6d94327ab30c1ddbe99246131e06f3c0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-03 08:35:50 +00:00
Alessandro Portale
9f53b0e13c ProjectExplorer: Themable miniprojecttargetselector.cpp
Replace some hard-coded colors with theme colors. That is required for
the Flat Light theme.

Change-Id: I2ce289fce8c2e6437148eb691484e0441975979f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-07-28 15:30:17 +00:00
Alessandro Portale
26246af9b3 ProjectExplorer: Don't cut off the summary label in the selector
Replace the manual height calculation with what Qt offers.

Task-number: QTCREATORBUG-16610
Change-Id: Icd18ef92d608d01c6343bb778343258d56461933
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-07-15 14:36:45 +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
Tobias Hunger
95ac4edfd4 Projectexplorer: Modernize codebase
Change-Id: I4793b58aa77bcd46af99f8b843c0f7439cdc9269
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
2016-04-15 09:40:53 +00:00
Alessandro Portale
22a262e8f6 ProjectExplorer: Flat desktop device icon for flat themes
This change flattens the desktop device icon in the mode bar. Only for
themes which set the FlatSideBarIcons flag.

":///DESKTOP///" deduplicates to Constants::DESKTOP_DEVICE_ICON

Change-Id: Ie31d9c501db2a1e36edbfac59abdd22a4d8c6773
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-03-23 08:57:59 +00:00
Orgad Shaneh
15f8bb07ed ProjectExplorer: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I619db09a79760186b72e7662490ed1205155c1a7
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-01 15:51:34 +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