Commit Graph

737 Commits

Author SHA1 Message Date
Aleix Pol
cf0f8d0c91 Make sure all prefixes are being used 2014-07-15 19:54:45 +02:00
Aleix Pol
89536abd9c Take into account that the requested prefix is not always the actually used prefix 2014-07-15 17:26:25 +02:00
Aleix Pol
4bde2d48dd Iterate over svgitem
Don't upload textures every time we resize, makes the resize much smoother.
Make it possible to show and hide borders
2014-07-15 16:28:41 +02:00
Martin Klapetek
06827054f4 Replace Calendar grid with Canvas
This patch simplifies the grid a bit more by using Canvas instead of
Rectangles, so actually lowering the number of Items needed to create
the grid from 16 to just 1.

It works pretty neatly with no junctions problem at all.

REVIEW: 119283
2014-07-15 13:53:34 +02:00
Aleix Pol
83895d8e26 Use proper sizes and positions 2014-07-14 20:02:47 +02:00
David Edmundson
dcbcb8a490 Construct full frame image using nodes inside FrameSVGItem 2014-07-14 18:44:33 +02:00
David Edmundson
9fc470089b If SvgItem size is 0, remove any nodes in the scenegraph 2014-07-14 17:23:33 +02:00
David Edmundson
96941f6c55 Use Atlas textures 2014-07-14 17:23:33 +02:00
Martin Klapetek
2f933387af Refactor the Calendar component a bit
Currently the grid itself is composed of 88 rectangles that draw all the
lines in a way that two big rect draws the whole two topmost horizontal
and leftmost vertical border lines and then each day rectangle is
drawing small bottom and right rect.

This patch reduces it to 13 rects only where one rect draws the whole
frame around the grid and then 1px wide/high rects draw the inner lines.
Results in much cleaner & simple code.

Plus there's a small refactor on the id names so it makes more sense.

This does not require any additional changes in the applets.

REVIEW: 119232
2014-07-12 13:52:34 +02:00
Frederik Gladhorn
445331bba8 Improve TextField accessibility
Qt Quick accessibility already picks up the text automatically. Instead
set the name (which is a descriptive element) to the placeholder text
which is more descriptive of the element. Otherwise Orca will read the
text twice.
2014-07-09 09:57:23 +02:00
Frederik Gladhorn
5199c9778a Fix accessible roles 2014-07-08 21:46:13 +02:00
Frederik Gladhorn
2f93b7f764 Add Accessibility properties
Also clean up increase and decrease actions for Slider a tiny bit.
2014-07-08 10:49:16 +02:00
Marco Martin
18b6d854a0 add missing files
REVIEW:118972
2014-06-27 15:13:46 +02:00
Marco Martin
6c54fb596d Don't expose color properties in c++ api
the color properties are remotely useful only when used from QML
and risk to explode in number in the future,
it's not a good thing for a public c++ api.

Also, they will become kinda deprecated as in largely replaced by
the ColorRole api. Too late to remove those properties completely,
but still last days to move them at least out of c++ api.
(and in qml they could be removed in the future in a 2.1 version
of the import while still being present in 2.0 if needed)

This moves the color properties is a theme subclass available only from QML

REVIEW:118972
2014-06-27 15:06:52 +02:00
Marco Martin
ffcc0d43d8 use correct highlight color
CCBUG:336775
2014-06-27 11:11:24 +02:00
David Edmundson
3cfa88f8c4 Add workaround for scrollview disabling keyboard interaction
See https://bugreports.qt-project.org/browse/QTBUG-31976

Reviewed-by: Marco Martin
2014-06-26 15:51:36 +02:00
Marco Martin
655e7fcc0d base on tabbar minimum width to show scrollbuttons
be more deterministic and now usually kickoff never shows the
scroll buttons

BUG:335392
2014-06-24 16:35:50 +02:00
Kai Uwe Broulik
347e073df3 Add paintedWidth and paintedHeight properties to WindowThumbnail
REVIEW: 118886
2014-06-23 19:58:15 +02:00
Aleix Pol
ce5d182510 Make Application component async
We're not using it for concatenating process calls, so it doesn't make
sense to make it block.

Reviewed by David Edmundson
2014-06-23 15:37:47 +02:00
David Edmundson
c317939aba Add notify property to colorGroup
REVIEW: 118841
2014-06-20 00:21:33 +02:00
Marco Martin
2c9103ee19 position the slider bar at margins
is a way in between the verious fix attempts of 332587
BUG:336448
CCBUG:332587
2014-06-19 20:57:49 +02:00
David Edmundson
66e2b915f6 Replace ScrollArea with a QQuickControls ScrollView
Included is a plasma theme to make it look the same.
A known regression is that SectionScroller is temporarily removed
but that is currently not used in plasma-desktop
and this fixes a lot more problems than it causes.

REVIEW: 114283
2014-06-19 20:10:38 +02:00
Marco Martin
8eb1bc10f5 Introduce the ColorScope class
it's an import in core, and advertises itself as an "attached property"
with this we can:
say that all its chidren are of a certain context, like "button" or
"complementary"

then anywhere there will be available an attached property, as ColorScope,
so like:

PlasmaCore.ColorScope {
 group: PlasmaCore.Theme.Complementary

 PlasmaComponents.Label {
   text: "foo"
   color: ColorScope.textColor
 }
}
2014-06-19 17:40:14 +02:00
David Edmundson
f22dd8e571 Replace incorrect documentation 2014-06-19 15:14:03 +02:00
David Edmundson
21af3f8c81 Don't require mandatory subText in tooltip
REVIEW: 118838
2014-06-19 15:12:26 +02:00
Sebastian Kügler
a5f25771a2 Reduce Units footprint
- internally, smallSpacing, largeSpacing and gridUnit are entangled, and
  all use the font's rendered size. This means we can save a
  QFontMetrics construction by merging the updating of these three
  props.
- A wanted side-effect is that the updating of spacing and gridunit now
  happens at the same time, so they're updated consistently in the UI.
- Also, use compile-time connects for the Plasma::Theme::themeChanged
  connection
2014-06-19 03:12:27 +02:00
Sebastian Kügler
f8422b903c Fix APIDOX for some properties 2014-06-19 03:10:43 +02:00
Sebastian Kügler
453c40efee increase units.smallSpacing
1/8 is really ridiculously small, it ends up being 2px on almost all
systems, and using it between UI elements makes them look really
cramped. 1/4 works much better, and makes this property actually useful.
2014-06-19 02:50:14 +02:00
Marco Martin
b755bd1e32 ColorGroup is part of Theme 2014-06-18 19:22:02 +02:00
Martin Gräßlin
d7d71e8a66 [declarativeimports/core] Do not crash if FadingMaterialShader failed to complie
Without GLSL our shader doesn't compile and Qt aborts when accessing the
uniforms. We don't want that, abort is never nice.

BUG: 336272
REVIEW: 118813
2014-06-18 15:13:58 +02:00
Marco Martin
1f633ad0a1 fix tooltip resize in folderview
also, detach from old layouts if the mainitem changes
2014-06-17 21:55:45 +02:00
Martin Klapetek
de43b9b547 Remove bad merge leftovers 2014-06-17 17:56:05 +02:00
Martin Klapetek
6240b9e7d5 [calendar import]Fix months capitalization
Should be done by the view/label rather than hardocding it
2014-06-17 17:55:01 +02:00
Martin Klapetek
b0f56eed9b [calendar import]Set 'today' properly 2014-06-17 17:54:32 +02:00
Martin Klapetek
da33d6211f [calendar import]Remove useless function 2014-06-17 17:25:05 +02:00
David Edmundson
b44e0205bc Add icon size "tiny"
REVIEW: 118798
2014-06-17 17:14:15 +02:00
Martin Klapetek
3188b417f4 Split startDate property into today and displayedDate in calendar component
Basically splits the Calendar::m_startDate into 'today' and
'displayedDate', where displayedDate is the date that is displayed (it
controls the days model etc) and can be manipulated by the user by eg.
changing months in the plasmoid, and today is the current day, populated
by our dataengine (which means it auto-updates with no need for a
timer).

This allows for greater flexibility and things like "Go back to today"
when eg. the plasmoid is hidden or when the user have browsed too far in
the calendar and just wants to get back to today (the button to do that
pending).

Also this fixes a problem where the time dataengine is being polled
every 30secs for the clock and would reset the calendar view as the
startDate is currently bound to the dataengine and the view resets on
that change.

REVIEW: 118668
CCBUG: 336304
2014-06-17 10:43:13 +02:00
Sebastian Kügler
bcde055673 Add test for ContextMenu
This enables and disabled menuitems with a timer, so we can see whether
dynamically updating these properties are propagated to the QMenu in the
proxy.

CCBUG:336281
2014-06-17 03:14:24 +02:00
Sebastian Kügler
5b38b9f850 Fix MenuItem.visible and MenuItem.enabled
Update visible and enabled property of the action backing MenuItem when
these properties change.

BUG:336281
2014-06-17 03:14:24 +02:00
Kai Uwe Broulik
76175fafa6 Handle mouse wheel events in PlasmaComponents.Slider
REVIEW: 118753
2014-06-16 20:07:16 +02:00
Marco Martin
01fc75aa78 more precise actionbutton
specific 22x22 graphics and ensure the graphic elements always have an even size

BUG:335547
2014-06-16 19:07:58 +02:00
Marco Martin
992b64a167 small workaround to show all the highlight borders
BUG:336210
2014-06-16 15:57:45 +02:00
Kai Uwe Broulik
60ddc9f25d Use RotationAnimator for BusyIndicator
This makes the animation run directly on the scene graph to not stress the CPU that much

REVIEW: 118769
CCBUG: 311799
CCBUG: 336274
2014-06-15 22:28:21 +02:00
Marco Martin
05d71947c8 svgColorGroup -> colorGroup 2014-06-13 15:40:47 +02:00
Marco Martin
09d0c44267 leave a bit of room around headings
make sure heights are integer
CCBUG:336123
2014-06-13 11:43:41 +02:00
Martin Klapetek
72c5aff002 Make the calendar heading & grid have the same margins
BUG: 336121
2014-06-12 13:56:08 +02:00
Martin Gräßlin
0d61746784 Small improvments to FadingNode and IconItem
* trigger an update after the animation finished as the IconItem needs to
  switch to SVGTextureNode again
* Don't connect needlessly to a lambda slot
* FadingMaterialShader had the texture bind swapped
* Fix virtual method hidden warning in FadingMaterialShader
* Use dynamic_cast instead of static_cast to convert to SVGTextureNode
  or FadingNode.

REVIEW: 118251
2014-06-11 07:55:01 +02:00
Marco Martin
fa95680a51 use color groups instead
the Text and Background colors can become buttonText or ButtonBackground
based on the svg property ColorGroup
2014-06-09 19:35:58 +02:00
Marco Martin
cac2704d50 prototype of more flexyble svg stylesheets
experiment in dynamic repacement of Text and Background
colors, in order to be able to generate icons of different colors
based on where they are (for instance if the normal background
is dark and the button background is light

at the moment supported an option to invert colors, one
to use the "highlight" color (if we want colored icons
on mouse over)
2014-06-09 17:35:46 +02:00
Bhushan Shah
86c1f46eaa Prevent crash when requesting icon with negative size
REVIEW: 118613
BUG: 335939
2014-06-08 22:39:54 +05:30
David Edmundson
73bb587ee9 Set catalog name in QueryDailog
REVIEW: 118557
2014-06-05 13:21:18 +02:00
Marco Martin
61dadaa558 minimize x move/resize calls
ensure starting and ending point of the animation are correct
BUG:335789
2014-06-05 12:09:52 +02:00
David Edmundson
7ea8e24584 Remove more unused QApplication includes 2014-06-04 18:57:18 +02:00
David Edmundson
8277da7015 Remove unused includes 2014-06-04 18:54:55 +02:00
David Edmundson
05485cf36f Remove unused include 2014-06-04 18:48:00 +02:00
David Edmundson
67b6bfc0c3 Remove unused include 2014-06-04 18:48:00 +02:00
Aleix Pol
6608359333 No need to forward the implicit* properties
It's not modifying anything or similar either.

Reviewed by David Edmundson
2014-06-04 16:55:14 +02:00
Marco Martin
051dabae5e warnings--
BUG:335522
2014-06-03 15:57:42 +02:00
Harald Sitter
ce329f4402 qmax(qreal, double) is not valid as qreal may be float
adjust the call to use qreal for both (floor() returns double)

REVIEW: 118487
2014-06-03 14:37:38 +02:00
Marco Martin
80195aa149 check for currentTab 2014-06-03 14:29:48 +02:00
David Edmundson
23068fb2b0 Avoid references to QApplication
They cause problems when running in QGuiApplication

REVIEW: 118470
2014-06-02 17:44:47 +02:00
Aleix Pol
1419eea367 Fix warning on ToolButton
If there's no parent for the ToolButton, always show all borders.
2014-05-29 18:39:31 +02:00
Marco Martin
f7adc059ee warnings--
BUG:335488
2014-05-29 12:14:09 +02:00
David Edmundson
8a59fe3643 Fix wrapping in tooltip subtexts
REVIEW: 118376
2014-05-28 16:24:54 +02:00
David Edmundson
78684c46cd Remove unnecessary placeholder
Text.implicitWidth holds the size the text would be if it wasn't
truncated
2014-05-28 16:24:50 +02:00
Marco Martin
a8f73abfbe warning--
BUG:335393
2014-05-28 12:32:57 +02:00
Martin Klapetek
aca024c2e0 Fix copy-paste calendar component bug 2014-05-27 17:44:08 +02:00
Martin Klapetek
19f21ec507 Equal margins on calendar grid from both sides 2014-05-27 17:44:08 +02:00
Marco Martin
140d066021 check for slots existence before blindly connecting 2014-05-27 17:13:57 +02:00
Antonis Tsiapaliokas
7916c9d766 Fix the PlasmaComponents.Sheet
*location property is now using the PlasmaCore.Types
*DialogStatus => PlasmaCore.DialogStatus
*windowFlags property => flags property
2014-05-27 17:56:37 +03:00
Marco Martin
66d65f1b12 QML warnings-- 2014-05-27 16:38:14 +02:00
Marco Martin
157d0ed836 use Qt::BypassWindowManagerHint
BUG:335267
2014-05-27 13:57:34 +02:00
Marco Martin
71b22cb89b tooltip is override redirect
CCBUG:335267
2014-05-27 13:39:12 +02:00
Martin Klapetek
12811f1fc4 Add the current month name to the calendar component by default
Currently we have 3 applets using the calendar grid and all of them put
the extra heading to the calendar. We also offer ways to change the
displayed month so we should also show /which/ month is the current one
displayed, implicitly.

REVIEW: 118328
BUG: 334147
2014-05-26 16:25:15 +02:00
Martin Klapetek
9f0765b002 Make sure we update the calendar on date change
This introduces new property on MonthView - "today". This property is
updated by dataengine (or can be a timer too, but we already get signals
from dataengine every 30 seconds to update the clock) and is never
updated by the code itself.

Furthermore, the DayDelegate is now bound to it, so when "today"
changes, the selection rectangle in the calendar should also change.

And finally, the selected item in the grid is cleared if MonthView's
date property is cleared (which is second part of this patch, to the
applet itself).

REVIEW: 118277
2014-05-26 13:40:47 +02:00
Sebastian Kügler
511495caad Make sure gridUnit is always an even number
This prevents subpixel alignment when gridUnit / 2 is used, which is
quite common.
2014-05-23 16:10:21 +02:00
Marco Martin
4cc6d84a81 try harder to use a pixel perfect size 2014-05-22 14:04:27 +02:00
Marco Martin
524ff23f25 add support for tooltips
use qwidget tooltips, not plasma ones
BUG:335131
2014-05-22 12:18:30 +02:00
Marco Martin
ab27f8b945 use view text color 2014-05-22 11:44:26 +02:00
Marco Martin
357647577f use view color for text in textfield
BUG:333837
2014-05-22 11:42:20 +02:00
David Edmundson
b06fe8301c Calculate implicitWidth of both button and toolbutton properly 2014-05-21 21:15:18 +02:00
David Edmundson
8b86279298 Match toolbutton sizing behaviour with button
Removing eliding in Toolbutton, this causes a binding loop as the
sizeHint is dependent on the paintedSize, which will change if you
elide.

In all cases we are trying to make toolbuttons fit the contents, so this
actually got in the way of that.
2014-05-21 20:07:36 +02:00
Martin Klapetek
5aa1e18f97 Elide Components' Button label
Otherwise the label can get out of the button boundaries. Tested with
RTL text too, it's elided properly as the elipsis switches to Left on
its own.

Reviewed-by: Marco Martin

BUG: 334867
2014-05-21 17:46:04 +02:00
David Edmundson
78e6000e72 Fix member variable capitalisation 2014-05-21 16:54:05 +02:00
David Edmundson
394e29fa34 When changing geometry always update 2014-05-21 15:38:23 +02:00
Marco Martin
bb10131fd4 support inverted layout 2014-05-21 15:03:37 +02:00
Eike Hein
cfda5c4d70 Update containsMouse even if tooltips are disabled globally.
ToolTipAreas are often the critical path for mouse handling, since
hover events are not filterable from below in the item hierarchy.
When disabling tooltips also stops updating containsMouse code has
no way to adapt, since there's no API to read the pref from within
QML. This changes the implementation of the pref to only prevent
tooltips from being shown, but still continue to handle hover events.
2014-05-19 10:25:25 +02:00
David Edmundson
2f16595036 Do not create a QSGNode when size is 0
This fixes a crash when resizing an icon to be super small
2014-05-16 15:44:25 +02:00
Martin Gräßlin
9653fad2f0 [declarative/core] Use proper GLXFBConfig for glxpixmap
We need to use a GLXFBConfig which matches the depth of the window
pixmap's depth. So far it used the GLXFBConfig of the GL context.
This worked fine for RGBA windows, but failed for RGB windows on e.g.
some NVIDIA drivers.

After this change the FBConfig of the context is completely ignored,
instead it tries to find a good FBConfig for a given depth.

Whenever a FBConfig for a given depth is found it's inserted in a
cache shared between all WindowThumbnails so that we don't have the
X roundtrips all the time.

BUG: 334241
REVIEW: 118110
2014-05-16 07:49:42 +02:00
David Edmundson
72c134b80f Update includes to be from QtGui 2014-05-15 18:42:46 +02:00
Martin Gräßlin
5e057da091 Do not overwrite event mask in WindowThumbnailItem
The WindowThumbnail needs XCB_EVENT_MASK_STRUCTURE_NOTIFY on the window.
For this it needs to change the window attributes. But it needs to keep
the existing event mask to not break other code. Also it cannot remove
the event mask again, as there is no chance to know whether another
component requires STRUCTURE_NOTIFY.

This fixes the not updating items in the tasks applet as the event mask
needed for KWindowSystem got overwritten.

BUG: 331956
REVIEW: 118137
2014-05-15 17:28:21 +02:00
David Edmundson
096c6d247b Port IconItem to native QSGTexture
Port IconItem to native QSGTexture including the animation.
This will save constantly uploading a new texture to OpenGL throughout the animation.

REVIEW: 116024
2014-05-15 16:19:59 +02:00
Martin Klapetek
2bd7101314 Calendar QML imports cleanup 2014-05-13 17:51:43 +02:00
Martin Klapetek
a4b08b0db3 Fix calendar font sizing
Reviewed-by: Sebastian Kügler
2014-05-13 17:44:45 +02:00
Martin Klapetek
247e829332 Proper if-else {} style 2014-05-12 19:21:06 +02:00
Allen Winter
939e01f554 fix build
include <cmath> to declare floor()
2014-05-11 20:58:53 -04:00
Marco Martin
39047a0ab8 layout fixes 2014-05-09 13:12:30 +02:00
Aleix Pol
556c1e321a Remove random qDebug output
Makes it easier to spot the actual problems on the output. If there's
something that's actually indicating a problem, we should make it a
qWarning.
2014-05-06 19:57:37 +02:00
David Edmundson
f123671346 Check the right items are valid in iconItem
Reviewed-By: Marco Martin
2014-05-06 16:33:20 +02:00
Marco Martin
9d24b7e391 ensure to repaint on repaintNeeded
BUG:334394
2014-05-06 11:49:21 +02:00