Merge branch 'master' of git://anongit.kde.org/plasma-framework
This commit is contained in:
commit
592222681c
@ -4,7 +4,7 @@ project(Plasma)
|
|||||||
|
|
||||||
# ECM setup
|
# ECM setup
|
||||||
include(FeatureSummary)
|
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")
|
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)
|
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||||
|
|
||||||
@ -20,8 +20,8 @@ include(ECMPackageConfigHelpers)
|
|||||||
include(ECMSetupVersion)
|
include(ECMSetupVersion)
|
||||||
include(KDEFrameworkCompilerSettings)
|
include(KDEFrameworkCompilerSettings)
|
||||||
|
|
||||||
set(KF5_VERSION "5.15.0") # handled by release scripts
|
set(KF5_VERSION "5.16.0") # handled by release scripts
|
||||||
set(KF5_DEP_VERSION "5.14.0") # handled by release scripts
|
set(KF5_DEP_VERSION "5.15.0") # handled by release scripts
|
||||||
|
|
||||||
ecm_setup_version(${KF5_VERSION}
|
ecm_setup_version(${KF5_VERSION}
|
||||||
VARIABLE_PREFIX PLASMA
|
VARIABLE_PREFIX PLASMA
|
||||||
|
@ -332,9 +332,12 @@ void ToolTip::hoverEnterEvent(QHoverEvent *event)
|
|||||||
// and ask to keep it open for a bit, so other items get the chance
|
// 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
|
// to update the content before the tooltip hides -- this avoids
|
||||||
// flickering
|
// flickering
|
||||||
tooltipDialogInstance()->keepalive();
|
// It need to be considered only when other items can deal with tooltip area
|
||||||
//FIXME: showToolTip needs to be renamed in sync or something like that
|
if (m_active) {
|
||||||
showToolTip();
|
tooltipDialogInstance()->keepalive();
|
||||||
|
//FIXME: showToolTip needs to be renamed in sync or something like that
|
||||||
|
showToolTip();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
m_showTimer->start(m_interval);
|
m_showTimer->start(m_interval);
|
||||||
}
|
}
|
||||||
|
@ -18,22 +18,27 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
//import "." 2.0
|
import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ToolBarLayout is a container for items on a toolbar that automatically
|
* ToolBarLayout is a container for items on a toolbar that automatically
|
||||||
* implements an appropriate layout for its children.
|
* implements an appropriate layout for its children.
|
||||||
* @inherit QtQuick.Row
|
* @inherit QtQuick.Layouts.RowLayout
|
||||||
*/
|
*/
|
||||||
Row {
|
RowLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
visible: false
|
visible: false
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: spacer
|
id: spacer1
|
||||||
width: 10
|
Layout.fillWidth: true
|
||||||
height: 10
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
id: spacer2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
}
|
}
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
@ -41,26 +46,36 @@ Row {
|
|||||||
property bool layouting: false
|
property bool layouting: false
|
||||||
function layoutChildren()
|
function layoutChildren()
|
||||||
{
|
{
|
||||||
var numChildren = root.children.length
|
if (layouting) {
|
||||||
if (layouting || parent == null ||
|
return;
|
||||||
root.width == 0 || numChildren < 2) {
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
layouting = true
|
layouting = true;
|
||||||
spacer.parent = null
|
|
||||||
|
|
||||||
spacer.width = root.parent.width - root.childrenRect.width -10
|
spacer1.parent = null;
|
||||||
|
spacer2.parent = null;
|
||||||
|
|
||||||
var last = root.children[numChildren-2]
|
var children = Array();
|
||||||
last.parent = null
|
//seems there is no other way to create a copy of the array
|
||||||
spacer.parent = root
|
//as children is not an actual JS array
|
||||||
last.parent = root
|
for (var i = 0; i < root.children.length; ++i) {
|
||||||
layouting = false
|
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()
|
Component.onCompleted: internal.layoutChildren()
|
||||||
onChildrenChanged: internal.layoutChildren()
|
onChildrenChanged: internal.layoutChildren()
|
||||||
onWidthChanged: internal.layoutChildren()
|
|
||||||
}
|
}
|
||||||
|
@ -568,7 +568,7 @@ QList<QAction *> Applet::contextualActions()
|
|||||||
|
|
||||||
KActionCollection *Applet::actions() const
|
KActionCollection *Applet::actions() const
|
||||||
{
|
{
|
||||||
return d->actions ? d->actions : new KActionCollection((QObject *)this);
|
return d->actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
Types::FormFactor Applet::formFactor() const
|
Types::FormFactor Applet::formFactor() const
|
||||||
|
@ -152,7 +152,7 @@ QRect DialogPrivate::availableScreenGeometryForPosition(const QPoint& pos) const
|
|||||||
// we simply iterate over the virtual screens and pick the one our QWindow
|
// we simply iterate over the virtual screens and pick the one our QWindow
|
||||||
// says it's at.
|
// says it's at.
|
||||||
QRect avail;
|
QRect avail;
|
||||||
Q_FOREACH (QScreen *screen, q->screen()->virtualSiblings()) {
|
Q_FOREACH (QScreen *screen, QGuiApplication::screens()) {
|
||||||
//we check geometry() but then take availableGeometry()
|
//we check geometry() but then take availableGeometry()
|
||||||
//to reliably check in which screen a position is, we need the full
|
//to reliably check in which screen a position is, we need the full
|
||||||
//geometry, including areas for panels
|
//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
|
* 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
|
* more reliable anyways (could be tried to remove the whole Q_FOREACH
|
||||||
* at this point)
|
* at this point)
|
||||||
|
*
|
||||||
|
* imporant: screen can be a nullptr... see bug 345173
|
||||||
*/
|
*/
|
||||||
if (avail.isEmpty()) {
|
if (avail.isEmpty() && q->screen()) {
|
||||||
avail = q->screen()->availableGeometry();
|
avail = q->screen()->availableGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1063,7 +1065,9 @@ void Dialog::showEvent(QShowEvent *event)
|
|||||||
|
|
||||||
bool Dialog::event(QEvent *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);
|
d->updateVisibility(true);
|
||||||
} else if (event->type() == QEvent::Hide) {
|
} else if (event->type() == QEvent::Hide) {
|
||||||
d->updateVisibility(false);
|
d->updateVisibility(false);
|
||||||
@ -1161,11 +1165,7 @@ bool Dialog::event(QEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool retval = QQuickWindow::event(event);
|
return QQuickWindow::event(event);
|
||||||
if (event->type() != QEvent::DeferredDelete) {
|
|
||||||
KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
|
|
||||||
}
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dialog::hideEvent(QHideEvent *event)
|
void Dialog::hideEvent(QHideEvent *event)
|
||||||
|
72
src/tools/apply-stylesheet.sh
Executable file
72
src/tools/apply-stylesheet.sh
Executable 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
|
@ -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 {
|
PlasmaCore.ToolTipArea {
|
||||||
width: 300
|
width: 300
|
||||||
height: 50
|
height: 50
|
||||||
|
Loading…
x
Reference in New Issue
Block a user