Merge branch 'master' of git://anongit.kde.org/plasma-framework

This commit is contained in:
andreas kainz 2015-10-12 11:42:14 +02:00
commit 592222681c
7 changed files with 144 additions and 34 deletions

View File

@ -4,7 +4,7 @@ project(Plasma)
# ECM setup
include(FeatureSummary)
find_package(ECM 5.14.0 NO_MODULE)
find_package(ECM 5.15.0 NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
@ -20,8 +20,8 @@ include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(KDEFrameworkCompilerSettings)
set(KF5_VERSION "5.15.0") # handled by release scripts
set(KF5_DEP_VERSION "5.14.0") # handled by release scripts
set(KF5_VERSION "5.16.0") # handled by release scripts
set(KF5_DEP_VERSION "5.15.0") # handled by release scripts
ecm_setup_version(${KF5_VERSION}
VARIABLE_PREFIX PLASMA

View File

@ -332,9 +332,12 @@ void ToolTip::hoverEnterEvent(QHoverEvent *event)
// and ask to keep it open for a bit, so other items get the chance
// to update the content before the tooltip hides -- this avoids
// flickering
tooltipDialogInstance()->keepalive();
//FIXME: showToolTip needs to be renamed in sync or something like that
showToolTip();
// It need to be considered only when other items can deal with tooltip area
if (m_active) {
tooltipDialogInstance()->keepalive();
//FIXME: showToolTip needs to be renamed in sync or something like that
showToolTip();
}
} else {
m_showTimer->start(m_interval);
}

View File

@ -18,22 +18,27 @@
*/
import QtQuick 2.1
//import "." 2.0
import QtQuick.Layouts 1.1
/**
* ToolBarLayout is a container for items on a toolbar that automatically
* implements an appropriate layout for its children.
* @inherit QtQuick.Row
* @inherit QtQuick.Layouts.RowLayout
*/
Row {
RowLayout {
id: root
visible: false
Item {
id: spacer
width: 10
height: 10
id: spacer1
Layout.fillWidth: true
Layout.fillHeight: true
}
Item {
id: spacer2
Layout.fillWidth: true
Layout.fillHeight: true
}
QtObject {
@ -41,26 +46,36 @@ Row {
property bool layouting: false
function layoutChildren()
{
var numChildren = root.children.length
if (layouting || parent == null ||
root.width == 0 || numChildren < 2) {
return
if (layouting) {
return;
}
layouting = true
spacer.parent = null
layouting = true;
spacer.width = root.parent.width - root.childrenRect.width -10
spacer1.parent = null;
spacer2.parent = null;
var last = root.children[numChildren-2]
last.parent = null
spacer.parent = root
last.parent = root
layouting = false
var children = Array();
//seems there is no other way to create a copy of the array
//as children is not an actual JS array
for (var i = 0; i < root.children.length; ++i) {
children.push(root.children[i]);
}
var numChildren = children.length;
spacer1.parent = root;
for (var i = 1; i < numChildren-1; ++i) {
children[i].parent = null;
children[i].parent = root;
}
spacer2.parent = root;
children[numChildren-1].parent = null;
children[numChildren-1].parent = root;
layouting = false;
}
}
Component.onCompleted: internal.layoutChildren()
onChildrenChanged: internal.layoutChildren()
onWidthChanged: internal.layoutChildren()
}

View File

@ -568,7 +568,7 @@ QList<QAction *> Applet::contextualActions()
KActionCollection *Applet::actions() const
{
return d->actions ? d->actions : new KActionCollection((QObject *)this);
return d->actions;
}
Types::FormFactor Applet::formFactor() const

View File

@ -152,7 +152,7 @@ QRect DialogPrivate::availableScreenGeometryForPosition(const QPoint& pos) const
// we simply iterate over the virtual screens and pick the one our QWindow
// says it's at.
QRect avail;
Q_FOREACH (QScreen *screen, q->screen()->virtualSiblings()) {
Q_FOREACH (QScreen *screen, QGuiApplication::screens()) {
//we check geometry() but then take availableGeometry()
//to reliably check in which screen a position is, we need the full
//geometry, including areas for panels
@ -168,8 +168,10 @@ QRect DialogPrivate::availableScreenGeometryForPosition(const QPoint& pos) const
* the screen should be correctly updated now on Qt 5.3+ so should be
* more reliable anyways (could be tried to remove the whole Q_FOREACH
* at this point)
*
* imporant: screen can be a nullptr... see bug 345173
*/
if (avail.isEmpty()) {
if (avail.isEmpty() && q->screen()) {
avail = q->screen()->availableGeometry();
}
@ -1063,7 +1065,9 @@ void Dialog::showEvent(QShowEvent *event)
bool Dialog::event(QEvent *event)
{
if (event->type() == QEvent::Show) {
if (event->type() == QEvent::Expose) {
KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
} else if (event->type() == QEvent::Show) {
d->updateVisibility(true);
} else if (event->type() == QEvent::Hide) {
d->updateVisibility(false);
@ -1161,11 +1165,7 @@ bool Dialog::event(QEvent *event)
}
}
const bool retval = QQuickWindow::event(event);
if (event->type() != QEvent::DeferredDelete) {
KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
}
return retval;
return QQuickWindow::event(event);
}
void Dialog::hideEvent(QHideEvent *event)

72
src/tools/apply-stylesheet.sh Executable file
View File

@ -0,0 +1,72 @@
#!/bin/bash
if [ $# -ne 1 ];
then echo Usage: $0 file.svgz
exit 1
fi
if [ ! -f $1 ]; then
echo "you must specify a valid svg"
exit 1
fi
file=`echo $1 | cut -d'.' --complement -f2-`
mv $1 $file.svg.gz
gunzip $file.svg.gz
echo Processing $file
stylesheet='
.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
'
colors=(\#31363b \#eff0f1 \#3daee9 \#fcfcfc \#93cee9)
colorNames=(ColorScheme-Text ColorScheme-Background ColorScheme-Highlight ColorScheme-ViewBackground ColorScheme-ViewHover)
xml ed --subnode "/svg:svg/svg:defs" -t elem -n "style" -v "$stylesheet"\
--subnode "/svg:svg/svg:defs/style" -t attr -n "type" -v "text/css"\
--subnode "/svg:svg/svg:defs/style" -t attr -n "id" -v "current-color-scheme" $file.svg > temp.svg
for i in {0..4}
do
xml ed --subnode "//*/*[contains(@style, '${colors[i]}')]" -t attr -n "class" -v "${colorNames[i]}" temp.svg > temp2.svg
mv temp2.svg temp.svg
echo sed -i 's/\(style=".*\)fill:'${colors[i]}'/\1fill:currentColor/g' temp.svg
done
mv temp.svg $file.svgz
gzip $file.svg
mv $file.svg.gz $file.svgz

View File

@ -85,6 +85,26 @@ Rectangle {
}
}
PlasmaCore.ToolTipArea {
width: 300
height: 50
active: false
mainText: "A"
subText: "B"
Rectangle {
color: "red"
anchors.fill: parent
}
Text {
anchors.fill: parent
text: "tooltip exists but inactive"
}
}
PlasmaCore.ToolTipArea {
width: 300
height: 50