From 52caeffe22bb6fac59e10b2f983addc82815fa94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Tue, 22 May 2012 19:32:53 +0200 Subject: [PATCH] get rid of hardcoded qml ui elements REVIEW: 105018 CCBUG: 291612 --- kcmkwin/kwindecoration/CMakeLists.txt | 3 +- kcmkwin/kwindecoration/decoration.ui | 24 ++- kcmkwin/kwindecoration/kwindecoration.cpp | 51 +++++- kcmkwin/kwindecoration/kwindecoration.h | 10 +- .../kwindecoration/qml/OxygenScrollbar.qml | 158 ------------------ kcmkwin/kwindecoration/qml/images/arrowup.png | Bin 194 -> 0 bytes .../qml/images/arrowupactive.png | Bin 219 -> 0 bytes kcmkwin/kwindecoration/qml/images/bg.png | Bin 263 -> 0 bytes kcmkwin/kwindecoration/qml/images/glow.png | Bin 406 -> 0 bytes kcmkwin/kwindecoration/qml/images/scrool.png | Bin 621 -> 0 bytes .../qml/images/scroolactive.png | Bin 882 -> 0 bytes kcmkwin/kwindecoration/qml/images/shadow.png | Bin 390 -> 0 bytes kcmkwin/kwindecoration/qml/main.qml | 104 ++++-------- 13 files changed, 104 insertions(+), 246 deletions(-) delete mode 100644 kcmkwin/kwindecoration/qml/OxygenScrollbar.qml delete mode 100644 kcmkwin/kwindecoration/qml/images/arrowup.png delete mode 100644 kcmkwin/kwindecoration/qml/images/arrowupactive.png delete mode 100644 kcmkwin/kwindecoration/qml/images/bg.png delete mode 100644 kcmkwin/kwindecoration/qml/images/glow.png delete mode 100644 kcmkwin/kwindecoration/qml/images/scrool.png delete mode 100644 kcmkwin/kwindecoration/qml/images/scroolactive.png delete mode 100644 kcmkwin/kwindecoration/qml/images/shadow.png diff --git a/kcmkwin/kwindecoration/CMakeLists.txt b/kcmkwin/kwindecoration/CMakeLists.txt index 4762bb983b..da02993ce9 100644 --- a/kcmkwin/kwindecoration/CMakeLists.txt +++ b/kcmkwin/kwindecoration/CMakeLists.txt @@ -30,5 +30,4 @@ install(TARGETS kcm_kwindecoration DESTINATION ${PLUGIN_INSTALL_DIR} ) ########### install files ############### install( FILES kwindecoration.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES qml/main.qml qml/AuroraeDecoration.qml qml/AuroraePreview.qml qml/OxygenScrollbar.qml DESTINATION ${DATA_INSTALL_DIR}/kwin/kcm_kwindecoration) -install( DIRECTORY qml/images/ DESTINATION ${DATA_INSTALL_DIR}/kwin/kcm_kwindecoration/images) +install( FILES qml/main.qml qml/AuroraeDecoration.qml qml/AuroraePreview.qml DESTINATION ${DATA_INSTALL_DIR}/kwin/kcm_kwindecoration) diff --git a/kcmkwin/kwindecoration/decoration.ui b/kcmkwin/kwindecoration/decoration.ui index 34cdcc3bc3..6451586d7b 100644 --- a/kcmkwin/kwindecoration/decoration.ui +++ b/kcmkwin/kwindecoration/decoration.ui @@ -7,10 +7,10 @@ 0 0 681 - 515 + 595 - + @@ -26,6 +26,15 @@ Select the window decoration. This is the look and feel of both the window borders and the window handle. + + QFrame::StyledPanel + + + QFrame::Sunken + + + Qt::ScrollBarAlwaysOn + @@ -70,15 +79,20 @@ - KPushButton - QPushButton -
kpushbutton.h
+ QDeclarativeView + QGraphicsView +
QtDeclarative/QDeclarativeView
KLineEdit QLineEdit
klineedit.h
+ + KPushButton + QPushButton +
kpushbutton.h
+
searchEdit diff --git a/kcmkwin/kwindecoration/kwindecoration.cpp b/kcmkwin/kwindecoration/kwindecoration.cpp index 3445ea7d87..6d9e729670 100644 --- a/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kcmkwin/kwindecoration/kwindecoration.cpp @@ -34,12 +34,15 @@ #include "decorationmodel.h" #include "auroraetheme.h" // Qt +#include #include #include #include +#include #include #include #include +#include // KDE #include #include @@ -89,10 +92,6 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const QVariantList & m_proxyModel->setSourceModel(m_model); m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); m_ui->decorationList->setResizeMode(QDeclarativeView::SizeRootObjectToView); - m_ui->decorationList->setAttribute(Qt::WA_TranslucentBackground); - QPalette pal = m_ui->decorationList->palette(); - pal.setColor(m_ui->decorationList->backgroundRole(), Qt::transparent); - m_ui->decorationList->setPalette(pal); foreach (const QString &importPath, KGlobal::dirs()->findDirs("module", "imports")) { m_ui->decorationList->engine()->addImportPath(importPath); } @@ -106,11 +105,20 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const QVariantList & connect(m_ui->decorationList->rootObject(), SIGNAL(currentIndexChanged()), SLOT(slotSelectionChanged())); connect(m_ui->decorationList->rootObject(), SIGNAL(widthChanged()), m_model, SLOT(regeneratePreviews())); + connect(m_ui->decorationList->rootObject(), SIGNAL(contentYChanged()), SLOT(updateScrollbarValue())); + connect(m_ui->decorationList->rootObject(), SIGNAL(contentHeightChanged()), SLOT(updateScrollbarRange())); connect(m_ui->configureButtonsButton, SIGNAL(clicked(bool)), this, SLOT(slotConfigureButtons())); connect(m_ui->ghnsButton, SIGNAL(clicked(bool)), SLOT(slotGHNSClicked())); connect(m_ui->searchEdit, SIGNAL(textChanged(QString)), m_proxyModel, SLOT(setFilterFixedString(QString))); connect(m_ui->configureDecorationButton, SIGNAL(clicked(bool)), SLOT(slotConfigureDecoration())); + m_ui->decorationList->disconnect(m_ui->decorationList->verticalScrollBar()); + m_ui->decorationList->verticalScrollBar()->disconnect(m_ui->decorationList); + connect(m_ui->decorationList->verticalScrollBar(), SIGNAL(rangeChanged(int, int )), SLOT(updateScrollbarRange())); + connect(m_ui->decorationList->verticalScrollBar(), SIGNAL(valueChanged(int)), SLOT(updateViewPosition(int))); + + m_ui->decorationList->installEventFilter(this); + KAboutData *about = new KAboutData(I18N_NOOP("kcmkwindecoration"), 0, ki18n("Window Decoration Control Module"), @@ -119,6 +127,7 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const QVariantList & about->addAuthor(ki18n("Karol Szwed"), KLocalizedString(), "gallium@kde.org"); setAboutData(about); m_model->regeneratePreviews(); + QMetaObject::invokeMethod(this, "setSliderWidth", Qt::QueuedConnection); } @@ -349,6 +358,40 @@ void KWinDecorationModule::slotConfigureDecoration() } } +bool KWinDecorationModule::eventFilter(QObject *o, QEvent *e) +{ + if (o == m_ui->decorationList && e->type() == QEvent::Resize) + updateScrollbarRange(); + return KCModule::eventFilter(o, e); +} +void KWinDecorationModule::setSliderWidth() +{ + m_ui->decorationList->rootContext()->setContextProperty("sliderWidth", m_ui->decorationList->verticalScrollBar()->width()); +} + +void KWinDecorationModule::updateScrollbarRange() +{ + m_ui->decorationList->verticalScrollBar()->blockSignals(true); + const int h = m_ui->decorationList->rootObject()->property("contentHeight").toInt(); + m_ui->decorationList->verticalScrollBar()->setRange(0, h - m_ui->decorationList->height()); + m_ui->decorationList->verticalScrollBar()->setPageStep(m_ui->decorationList->verticalScrollBar()->maximum()/m_model->rowCount()); + m_ui->decorationList->verticalScrollBar()->blockSignals(false); +} + +void KWinDecorationModule::updateScrollbarValue() +{ + const int v = m_ui->decorationList->rootObject()->property("contentY").toInt(); + m_ui->decorationList->verticalScrollBar()->blockSignals(true); // skippig this will kill kinetic scrolling but the scrollwidth is too low + m_ui->decorationList->verticalScrollBar()->setValue(v); + m_ui->decorationList->verticalScrollBar()->blockSignals(false); +} + +void KWinDecorationModule::updateViewPosition(int v) +{ + QGraphicsObject *list = m_ui->decorationList->rootObject(); + list->setProperty("contentY", v); +} + DecorationButtons::DecorationButtons(QObject *parent) : QObject(parent) , m_customPositions(false) diff --git a/kcmkwin/kwindecoration/kwindecoration.h b/kcmkwin/kwindecoration/kwindecoration.h index a78a56a69f..e1d7556daa 100644 --- a/kcmkwin/kwindecoration/kwindecoration.h +++ b/kcmkwin/kwindecoration/kwindecoration.h @@ -105,6 +105,9 @@ signals: void pluginSave(KConfigGroup &conf); void pluginDefaults(); +protected: + bool eventFilter(QObject *o, QEvent *e); + protected slots: // Allows us to turn "save" on void slotSelectionChanged(); @@ -115,7 +118,12 @@ protected slots: private: void readConfig(const KConfigGroup& conf); void writeConfig(KConfigGroup &conf); - +private slots: + void setSliderWidth(); + void updateScrollbarRange(); + void updateScrollbarValue(); + void updateViewPosition(int v); +private: KSharedConfigPtr kwinConfig; KWinDecorationForm* m_ui; diff --git a/kcmkwin/kwindecoration/qml/OxygenScrollbar.qml b/kcmkwin/kwindecoration/qml/OxygenScrollbar.qml deleted file mode 100644 index a089fd7383..0000000000 --- a/kcmkwin/kwindecoration/qml/OxygenScrollbar.qml +++ /dev/null @@ -1,158 +0,0 @@ -/******************************************************************** -Copyright (C) 2012 Nuno Pinheiro - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ -import QtQuick 1.0 - -Item { - property variant list - property int itemHeight: 1 - id: verticalScroolbar - width:19 - height: parent.height-1 - anchors.right: parent.right - anchors.rightMargin: 2 - clip:true - - Item { - id: scroolerArea - width: parent.width - height: parent.height-uparrow.height*2 - y:uparrow.height - opacity: scroolerAreaOver.containsMouse? 1:list.moving?1:dragarea.containsMouse? 1:dragarea.pressed?1: 0.3 - Behavior on opacity { - NumberAnimation { duration: 600 } - } - MouseArea { - id: scroolerAreaOver - anchors.bottomMargin:-uparrow.height - anchors.topMargin: -uparrow.height - anchors.fill: parent - hoverEnabled: true - - } - BorderImage { - id: scroller - source: "images/scrool.png" - width:parent.width - height:Math.max (14,parent.height*list.height/list.contentHeight) - y:parent.height*list.contentY/list.contentHeight - border.left: 7; border.top: 7 - border.right: 7; border.bottom: 8 - opacity: 1 - } - - BorderImage { - id: scrolleractive - source: "images/scroolactive.png" - width:parent.width - height:Math.max (14,parent.height*list.height/list.contentHeight) - y:parent.height*list.contentY/list.contentHeight - border.left: 7; border.top: 7 - border.right: 7; border.bottom: 8 - opacity:scroolerAreaOver.containsMouse? 1:dragarea.containsMouse?1:dragarea.pressed?1:0.01 - Behavior on opacity { - NumberAnimation { duration: 400 } - } - MouseArea{ - id:dragarea - anchors.fill:parent - hoverEnabled: true - drag.target: scrolleractive - drag.axis: Drag.YAxis - drag.minimumY: 0 - drag.maximumY: scroolerArea.height-scrolleractive.height - onPositionChanged: list.contentY=scrolleractive.y*list.contentHeight/(scroolerArea.height) - } - } - } - - Item{ - id:uparrow - width:parent.width - height: parent.width-4 - Image{ - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - source:"images/arrowup.png" - opacity:uparrowOver.containsMouse? 0:1 - - Behavior on opacity { - NumberAnimation { duration: 300 } - } - } - Image{ - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - source:"images/arrowupactive.png" - opacity: uparrowOver.containsMouse? 1:0 - Behavior on opacity { - NumberAnimation { duration: 300 } - } - } - MouseArea { - id: uparrowOver - anchors.fill: parent - hoverEnabled: true - onClicked: { - if (!list.atYBeginning) { - list.contentY -= itemHeight; - if (list.contentY < 0) { - list.contentY = 0; - } - } - } - } - } - - Item{ - id:downarrow - width:parent.width - height: parent.width-4 - anchors.bottom: parent.bottom - anchors.bottomMargin: 0 - Image{ - rotation: 180 - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - source:"images/arrowup.png" - opacity:downarrowOver.containsMouse? 0:1 - - Behavior on opacity { - NumberAnimation { duration: 300 } - } - } - Image{ - rotation: 180 - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - source:"images/arrowupactive.png" - opacity: downarrowOver.containsMouse? 1:0 - Behavior on opacity { - NumberAnimation { duration: 300 } - } - } - MouseArea { - id: downarrowOver - anchors.fill: parent - hoverEnabled: true - onClicked: { - if (!list.atYEnd) { - list.contentY += itemHeight; - } - } - } - } -} diff --git a/kcmkwin/kwindecoration/qml/images/arrowup.png b/kcmkwin/kwindecoration/qml/images/arrowup.png deleted file mode 100644 index ebb1d58912f1e1c5df30f160936cdc22eac82d4d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)I!3HFqj;YpyIK@t$Asj$Z!;#Vf2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4oR)vU~?8#_%ExEH}lI@)X&7vDF hvFDumuhrc7m(j~zEhS4mC<$m3gQu&X%Q~loCIG3YJT(9S diff --git a/kcmkwin/kwindecoration/qml/images/arrowupactive.png b/kcmkwin/kwindecoration/qml/images/arrowupactive.png deleted file mode 100644 index a92e3dbcc7800035bc46aaa697251f352a5da1c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)I!3HFqj;YpyIK@t$Asj$Z!;#Vf2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4nZdW06)3q=3>HHIcDgPOjV%5UBm)`IN+QH!I>gTe~ HDWM4fZKOyo diff --git a/kcmkwin/kwindecoration/qml/images/bg.png b/kcmkwin/kwindecoration/qml/images/bg.png deleted file mode 100644 index 5aa56957dc0a46f5fa11e8911e5f65d85cd804e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 263 zcmeAS@N?(olHy`uVBq!ia0vp^#z3sZ!3HEhX+IPJQY^(zo*^7SP{WbZ0pxQQctjQh z)n5l;MkkHg6+l7B64!{5;QX|b^2DN4hVt@qz0ADq;^f4FRK5J7^x5xhq=1TAJY5_^ zB3j?x+{oKtAmALRE+oBCfXCJIsM$%s`AwoqM;+^gf4n{=yn&JZLPYT6+xtZyOeo2& zO=q07r1sk+#wx}cdy}SERUh!^ESxG4j+5Bm{c^KA&!yE%vcGjXuG4xsu_Ws*cWLeK f`JWc6H^i+yaxY2r+|gE`dl)=j{an^LB{Ts5I&fY- diff --git a/kcmkwin/kwindecoration/qml/images/glow.png b/kcmkwin/kwindecoration/qml/images/glow.png deleted file mode 100644 index ec173b47455dbb4ca4038626afc8a68e94877af8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmeAS@N?(olHy`uVBq!ia0vp^#z3sZ!3HEhX+IPJQY^(zo*^7SP{WbZ0pxQQctjQh z)n5l;MkkHg6+l7B64!{5;QX|b^2DN4hVt@qz0ADq;^f4FRK5J7^x5xhq!<_&g*{yy zLn2z=-Zb<&oFLQoQ9VA`!`^V>goCP^15BGa^dx0i_ycS@pMOyL#?sW>yjVjwtl-6y zM+%CH65WPBZJfI%tpD_X?t|KA*B{>EajTYD?9n*m>}R*rf3IuvpUX(|^Ev!-L&8F@ zRr{uwUd>zlx}i4xz}#*n*)*LyJ(j$#_aE;HGG#pA@A8UiqgLgjg(vjP^ws7xX|3$& z2)&>DZ_<$)UP(EshTA4dM0@tERXG+Wl&sykaVnDV-_;W4A5X-aM6LaBIP-q-wMW~f z=2kp;cO>1CTatN27IQp9?>gsW!t<8~*UUaV+yC4;JC0}CWxwREhd!DZ?u|fsE{IVIr_+<_m&18z~YQZWQ1u^>o_4hJ;Z^vy|j*Mp_Gy4;N978e>2{ZMu`Y@ zm{SV{Sh6iDr4*nn7imDml7=$ZGJpd#foH%|1Ezrl_z4UFodb#p*|!23zVB}ZL9iQ! z;b{~_VtN>cr$G?x`o6yfG-g6XA$++=Ni zoiAUH_S)_CN8r1NXbLrOfK|`)cH%fDP192ClH?bI{yCoK?EtIh`66h=b=~dJXjFpC zY?vgtuDcDa+y_!XL$tmZa$DDFOd~r}0s$yp;eqPApL1)a2RVnLoRvWp6xm`*AYDO` zEykj#LTZ+n|01fiOD7rWUQWIu^G;rNJJ~6Ra=+MCcu#90J$b86ZE5YT)YA z{(fgX9yi~m-GWw6l)*3htjBE&djEeUP_}8@p9z2 zA;K%-Xgb9QFriRmsLCIS@nn?n=VqPJ1m;ha4P$Cy$ogvy-v7K^e)-{=zIS8A!r3}J z$=u10NAlCR``*{RG26qKec*%%sMAFT0b#>q^RssG#V675ZvXeE{2a%aDrzOBN}~~l zAK$!r*V-@HH$(rcQNXiKmoXhw9Js*%DTJ_IqjjfQ-tPDNj7FomhQ;xay~n?Cr&->v z*Ju?&I2a%foB$*VA|8P$&FeuKrfGUk?;(j}t_NjkN>e<7B&nJq07Zlgd<5`J^<2m# zPIJ7#M~bK#51Ah3I0L74IY>=0aF$n)GoXLIcHT%|oHGYnR?(%PE3C+tP_!s#{%T9i z(W0CMik7(Af}9tMu7sk0@jtp4^#6NnFBB~U`p?>bxuQimSA8J;4b1aUF?3l)VyNe# z{zm24Do~0QV@mVL4rt_DP;e39fJSZ}Suv*c(+SAIS_>7(tmJS<)*ot-vj`?m@I8+m zS$}9HhXUDJ3&nw$VcU<;EFw*OdiQDH`#!kUe_Ga5iyYGuXBFhoU)65-M*lwTdx=jk zi%7R0p=Q|BjK1?7LB7H2HP~FM@pf~CcLSeWW&{Avk>>?_!;D{!#_Yz>3kDoN_>_EV zMh(pEQoQ*A!(7?hSN=LF+3`K1((nL0M_H64&vK6Zlw%b}4|XZe*yBk|Z1Q99Bk;2n z(csjP<=9FcO`v!kidm0c&4k&R1?DhwY?)xst!mG4T9VoIH`BTxMYy%6&Hw-a07*qo IM6N<$f+IDZ>i_@% diff --git a/kcmkwin/kwindecoration/qml/images/shadow.png b/kcmkwin/kwindecoration/qml/images/shadow.png deleted file mode 100644 index ee8dcfa530c52fc3ac59b96e8606f4b0ccce4626..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 390 zcmeAS@N?(olHy`uVBq!ia0vp^#z3sZ!3HEhX+IPJQY^(zo*^7SP{WbZ0pxQQctjQh z)n5l;MkkHg6+l7B64!{5;QX|b^2DN4hVt@qz0ADq;^f4FRK5J7^x5xhq!<_&nLS+` zLn2z=-cwA(g9=b)J}v>2=G?{|p(89thrG{5xrN zniaE^f_DRV0)I`#`+Bjtrp+BaKEJt{Wf~Yibg!Fr-uSJ(#G~FHr`PMHnVP7DNC|88 za!x(g;+5>Q)NtXY83CC-Ds+IKEXtZ8Izd?}uvPYZUc=h0Wgc^iV`Hyt ze&F3Be?KodvB6uR^jzts@3q&qy^W2WrtW)rj?nc$iS9)|)~tG^eg1Rx$9vKb+J4y2 co>$Kp+-?6vcArQzFw7V{UHx3vIVCg!0K|cm82|tP diff --git a/kcmkwin/kwindecoration/qml/main.qml b/kcmkwin/kwindecoration/qml/main.qml index fd04c3d6b2..e82e00b184 100644 --- a/kcmkwin/kwindecoration/qml/main.qml +++ b/kcmkwin/kwindecoration/qml/main.qml @@ -18,85 +18,37 @@ along with this program. If not, see . import QtQuick 1.1 import org.kde.qtextracomponents 0.1 as QtExtra -BorderImage { - property alias currentIndex: listView.currentIndex - source: "images/bg.png" - border { - left: 4 - top: 4 - right: 4 - bottom: 4 +ListView { + id: listView + x: 0 + y: 0 + model: decorationModel + highlight: Rectangle { + width: listView.width - sliderWidth + height: 150 + color: highlightColor + opacity: 0.5 } - - MouseArea { - id: focusOver - anchors.fill: parent - hoverEnabled: true - } - - ListView { - id: listView - x: 3 - height: parent.height - 1 // -1 on the account of the last pixel being a glow pixel - width: parent.width - 6 - scrollbar.width - model: decorationModel - highlight: Rectangle { - width: listView.width - height: 150 - color: highlightColor - opacity: 0.5 + highlightMoveDuration: 250 + boundsBehavior: Flickable.StopAtBounds + delegate: Item { + width: listView.width - sliderWidth + height: 150 + QtExtra.QPixmapItem { + pixmap: preview + anchors.fill: parent + visible: type == 0 } - highlightMoveDuration: 250 - boundsBehavior: Flickable.StopAtBounds - delegate: Item { - width: listView.width - height: 150 - QtExtra.QPixmapItem { - pixmap: preview - anchors.fill: parent - visible: type == 0 - } - Loader { - source: type == 1 ? "AuroraePreview.qml" : "" - anchors.fill: parent - } - MouseArea { - hoverEnabled: false - anchors.fill: parent - onClicked: { - listView.currentIndex = index; - } - } + Loader { + source: type == 1 ? "AuroraePreview.qml" : "" + anchors.fill: parent } - } - OxygenScrollbar { - id: scrollbar - list: listView - itemHeight: 150 - } - - BorderImage { - id: shadow - source: "images/shadow.png" - anchors.fill:parent - border.left: 4; border.top: 4 - border.right: 4; border.bottom: 5 - opacity:focusOver.containsMouse? 0.01:1 //insert here a proper focus mechanism - Behavior on opacity { - NumberAnimation { duration: 300 } - } - - } - - BorderImage { - id: glow - source: "images/glow.png" - anchors.fill:parent - border.left: 4; border.top: 4 - border.right: 4; border.bottom: 5 - opacity:focusOver.containsMouse? 1:0 //insert here a proper focus mechanism - Behavior on opacity { - NumberAnimation { duration: 300 } + MouseArea { + hoverEnabled: false + anchors.fill: parent + onClicked: { + listView.currentIndex = index; + } } } }