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>
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>
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>
- 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>
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>
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>
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>
This way, currentIndex() is the right one during
currentModeAboutToChange() execution.
Change-Id: Ibe6282b6266aef8b4a536855ff01f2016cc25f43
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
And adapting darkframe.creatortheme accordingly to match Diana's
specification
Change-Id: I9e1f62869ff91d7cfd3a26f51d26225d549a0965
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
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>
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>
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>
Fixing the painting of selected tabs and using QPixmapCache,
to reduce slow gradinet painting.
Fixing the outlines around the background gradient
Task-number: QTCREATORBUG-15222
Change-Id: I5973da1457a94be45610a21b643eddaa5380e1e0
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
next if file =~ %r{src/shared/qbs|/qmljs/}
s = File.read(file)
s.scan(/^using namespace (.*);$/) {
ns = $1
t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
before = $1
char = $2
if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
m
else
before + char
end
}
if t != s
puts file
File.open(file, 'w').write(t)
end
}
}
Change-Id: I5c6690f51488bf8ca3610ba9fb11e6e5fd814aaa
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
Adds a 'Theme' tab to the environment settings and a '-theme' command
line option.
A theme is a combination of colors, gradients, flags and style
information.
There are two themes:
- 'default': preserves the current default look
- 'dark': uses a more flat for many widgets, dark color theme
for everything
This does not use a stylesheet (too limited), but rather sets
the palette via C++ and modifies drawing behavior.
Overall, the look is more flat (removed some gradients and bevels).
Tested on Ubuntu 14.04 using Qt 5.4 and running on a KDE
Desktop (Oxygen base style).
For a screenshot, see
https://gist.github.com/thorbenk/5ab06bea726de0aa7473
Changes:
- Introduce class Theme, defining the interface how to access theme
specific settings. The class reads a .creatortheme file (INI file, via
QSettings)
- Define named colors in the [Palette] section
(see dark.creatortheme for example usage)
- Use either named colors of AARRGGBB (hex) in the [Colors]
section
- A file ending with .creatortheme may be supplied
to the '-theme' command line option
- A global Theme instance can be accessed via creatorTheme()
- Query colors, gradients, icons and flags from the theme
were possible (TODO: use this in more places...)
- There are very many color roles. It seems better to me
to describe the role clearly, and then to consolidate later
in the actual theme by assigning the same color.
For example, one can set the text color of the output pane button
individualy.
- Many elements are also drawn differently.
For the dark theme, I wanted to have a flatter look.
- Introduce Theme::WidgetStyle enum, for now {Original, Flat}.
- The theme specifies which kind of widget style it wants.
- The drawing code queries the theme's style flag and
switches between the original, gradient based look and
the new, flat look.
- Create some custom icons which look better on dark background
(wip, currently folder/file icons)
- Let ManhattanStyle draw some elements for non-panelwidgets, too
(open/close arrows in QTreeView, custom folder/file icons)
- For the welcomescreen, pass the WelcomeTheme class.
WelcomeTheme exposes theme colors as Q_PROPERTY accessible from
.qml
- Themes can be modified via the 'Themes' tab in the environment
settings.
TODO:
* Unify image handling
* Avoid style name references
* Fix gradients
Change-Id: I92c2050ab0fb327649ea1eff4adec973d2073944
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>