Commit Graph

767 Commits

Author SHA1 Message Date
Marco Martin
d29b3f051d don't mix anchors and layouts 2014-07-25 11:20:26 +02:00
Marco Martin
7538c3292c don't compute two times the same thing 2014-07-24 20:16:46 +02:00
Marco Martin
0c2138916e use RowLayout 2014-07-24 20:11:31 +02:00
Marco Martin
b538a1dca9 override iconSource for compatibility 2014-07-24 19:19:26 +02:00
Marco Martin
9301163142 support checked buttons 2014-07-24 18:30:55 +02:00
Marco Martin
2e06bb3214 create arrow on demand, layout it correctly 2014-07-24 18:29:48 +02:00
Marco Martin
9b06cbc392 style doesn't depend from control properties 2014-07-24 17:47:19 +02:00
Marco Martin
a39c8898b3 don't redefine iconSource 2014-07-24 17:38:13 +02:00
Marco Martin
9365123152 fix minimumWidth/height
don't try to access undefined properties

make the style and the control as independent as possible
2014-07-24 17:11:19 +02:00
Marco Martin
02c6bba518 initial port of Button to QtControls
still loads of layout problems
2014-07-24 15:58:14 +02:00
David Edmundson
c127b78d57 Always take the slow path for composeOverBorder
We previously only supported compose-over-border when the centre was not
set to tile.

It's possible to use compose over border with tile.. even if it doesn't
make much sense.

Given that creating an opacityMask loads most of the image anyway, we
can make use of the FrameSVG painter path and avoid any additional code
complexity here.

REVIEW: 119406
2014-07-23 15:54:13 +02:00
David Edmundson
bdb0b3b2ca Check for empty sized elements in original SVG
Reviewed-by: Aleix Pol
2014-07-22 13:35:44 +02:00
Aleix Pol
e613662ab5 Make framesvg unit test pass
Revert the changes in contentsRect, it was clearly not the best place to
put the code that contains the code that computes the content size.
Instead move the code in FrameSvgItem, duplicates data and code but works.
2014-07-22 03:14:26 +02:00
Aleix Pol
ab93d83890 Merge branch 'davidedmundson/framesvg_native'
Use FrameSVG as 9 tiles instead of uploading a big texture of the finished frame each time.
This also saves the cache being populated with full created frames in different sizes; which end up taking up space in the disk and shared memory cache as well as the GPU memory.
A code path falls back to the original uploading the entire texture if obscure settings are used, i.e overlay.

Benchmarks:
apitrace when resizing a frame goes from an average of 7.6ms per frame of CPU time just for the swizzling and uploading to 1.4ms
GPU time also drops from 40us to 10us

Themes will need to remove stretch-borders (when we gain nothing from stretching; i.e Breeze) to get the most out of it.

REVIEW: 119330
2014-07-21 18:38:11 +02:00
Aleix Pol
dca3958b44 Stop exposing that many things in FrameSvgItem
Move the shared code between FrameSvg and FrameSvgItem into a separate file
that both can link to.

Reviewed by David Edmundson
2014-07-21 18:01:26 +02:00
Aleix Pol
47c7688d02 Move some of the code and make some API public
It's unreasonable to use private API, so make everything public API so that
every user of FrameSvg have as much features exposed as possible.

Reviewed by David Edmundson
2014-07-21 15:44:25 +02:00
Lukáš Tinkl
3f07e41e2a i18n style fix 2014-07-18 22:36:42 +02:00
Aleix Pol
565b2b6f51 Add a guard after figuring out the contentRect for a framesvgitem 2014-07-18 12:44:06 +02:00
David Edmundson
3eee37bd81 Don't allow tiling + compose over border at the same time
It wouldn't make any sense. Just choose tiling
2014-07-17 22:42:26 +02:00
David Edmundson
371c9a53dd Add composeOverBorder support in FrameSVGItem 2014-07-17 22:29:54 +02:00
David Edmundson
2bf3466b53 Put compose over border onto the slow path that renders the entire item 2014-07-17 19:32:17 +02:00
David Edmundson
09e23eb675 Merge branch 'master' into davidedmundson/framesvg_native 2014-07-17 12:39:55 +02:00
David Edmundson
1924877140 Add code path FastStretch, which resizes without re-rendering 2014-07-16 22:51:29 +02:00
David Edmundson
be05a8394a Don't remove nodes from a parent whilst we're cycling through them 2014-07-16 22:22:43 +02:00
David Edmundson
6c0dadc1c2 tidy variable + method names + fix crash 2014-07-16 20:40:41 +02:00
David Edmundson
e037203748 Add tiling support 2014-07-16 20:40:41 +02:00
Aleix Pol
a4e3569bbd Introduce the FrameSvgItem fastPath alternative, opt out of it on overlays
Fallback to the old code if there's something not (yet?) handled by the
new implementation. This way we get to optimize for the the common use-case
without breaking former, complex, code-paths.

Reviewed by David Edmundson
2014-07-16 17:01:05 +02:00
Aleix Pol
cbe13ac765 Do a full repaint when frameSvg says a repaintNeeded 2014-07-16 13:51:53 +02:00
Aleix Pol
fc4e09df46 Add warning 2014-07-15 19:57:43 +02:00
Aleix Pol
0a94e1b1b8 Take composeOverBorder into accoun 2014-07-15 19:56:04 +02:00
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