Merge branch 'master' into plasma/terietorANDkokeroulis/KLocaleQMLBindings

This commit is contained in:
Giorgos Tsiapaliwkas 2012-01-22 10:50:12 +02:00
commit 64a70e4ae5
7 changed files with 37 additions and 17 deletions

View File

@ -71,11 +71,15 @@ public:
void mousePressEvent(QMouseEvent *event) void mousePressEvent(QMouseEvent *event)
{ {
event->accept(); event->accept();
m_dialog->view()->winId();
KWindowSystem::forceActiveWindow(m_dialog->view()->winId());
} }
void mouseReleaseEvent(QMouseEvent *event) void mouseReleaseEvent(QMouseEvent *event)
{ {
m_dialog->close(); if (!m_dialog->view()->geometry().contains(event->globalPos())) {
m_dialog->close();
}
} }
private: private:
@ -249,13 +253,23 @@ void FullScreenDialog::setVisible(const bool visible)
{ {
if (m_view->isVisible() != visible) { if (m_view->isVisible() != visible) {
m_background->setVisible(visible); m_background->setVisible(visible);
Plasma::WindowEffects::slideWindow(m_view->winId(), Plasma::BottomEdge, 0);
m_view->setVisible(visible); m_view->setVisible(visible);
unsigned long state = NET::Sticky | NET::StaysOnTop | NET::KeepAbove | NET::SkipTaskbar | NET::SkipPager;
KWindowSystem::setState(m_view->effectiveWinId(), state);
KWindowSystem::setState(m_background->effectiveWinId(), state);
if (visible) { if (visible) {
m_view->raise(); m_view->raise();
KWindowSystem::forceActiveWindow(m_view->effectiveWinId());
} }
} }
} }
QGraphicsView *FullScreenDialog::view() const
{
return m_view;
}
QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::title() QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::title()
{ {
if (m_rootObject) { if (m_rootObject) {
@ -339,10 +353,6 @@ bool FullScreenDialog::eventFilter(QObject *watched, QEvent *event)
if (watched == m_mainItem.data() && if (watched == m_mainItem.data() &&
(event->type() == QEvent::GraphicsSceneResize)) { (event->type() == QEvent::GraphicsSceneResize)) {
syncMainItem(); syncMainItem();
} else if (watched == m_view && event->type() == QEvent::Show) {
Plasma::WindowEffects::slideWindow(m_view->winId(), Plasma::BottomEdge, 0);
} else if (watched == m_view && event->type() == QEvent::Hide) {
Plasma::WindowEffects::slideWindow(m_view->winId(), Plasma::BottomEdge, 0);
} }
return false; return false;
} }

View File

@ -54,6 +54,7 @@ public:
bool isVisible() const; bool isVisible() const;
void setVisible(const bool visible); void setVisible(const bool visible);
QGraphicsView *view() const;
//QML properties //QML properties
QDeclarativeListProperty<QGraphicsObject> title(); QDeclarativeListProperty<QGraphicsObject> title();

View File

@ -168,10 +168,6 @@ Item {
} }
} }
Component.onCompleted: {
rootItem = Utils.rootObject()
}
states: [ states: [
State { State {
name: "closed" name: "closed"

View File

@ -66,7 +66,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore
Item { Item {
id: root id: root
/** /*
* The listview this scroll indicator will work on * The listview this scroll indicator will work on
*/ */
property ListView listView property ListView listView

View File

@ -167,15 +167,27 @@ CommonDialog {
reject() reject()
} }
Timer {
id: focusTimer
interval: 100
onTriggered: {
filterField.forceActiveFocus()
}
}
onStatusChanged: { onStatusChanged: {
//FIXME: why needs focus deactivation then activation?
if (status == DialogStatus.Open) {
filterField.focus = false
focusTimer.running = true
}
if (status == DialogStatus.Opening) { if (status == DialogStatus.Opening) {
if (listView.currentItem != null) { if (listView.currentItem != null) {
listView.currentItem.focus = false listView.currentItem.focus = false
} }
listView.currentIndex = -1 listView.currentIndex = -1
listView.positionViewAtIndex(0, ListView.Beginning) listView.positionViewAtIndex(0, ListView.Beginning)
} } else if (status == DialogStatus.Open) {
else if (status == DialogStatus.Open) {
listView.focus = true listView.focus = true
} }
} }

View File

@ -90,8 +90,8 @@ Item {
signal clicked signal clicked
implicitWidth: label.paintedWidth + (internal.portrait ? 0 : (iconSource != "" ? 16 : 0)) implicitWidth: label.paintedWidth + (internal.portrait ? 0 : (iconSource != null ? 16 : 0))
implicitHeight: label.paintedHeight + (internal.portrait ? (iconSource != "" ? 16 : 0) : 0) implicitHeight: label.paintedHeight + (internal.portrait ? (iconSource != null ? 16 : 0) : 0)
//long notation to not make it overwritten by implementations //long notation to not make it overwritten by implementations
Connections { Connections {
@ -129,14 +129,14 @@ Item {
objectName: "label" objectName: "label"
anchors { anchors {
top: internal.portrait && iconSource != "" ? imageLoader.bottom : parent.top top: internal.portrait && iconSource != null ? imageLoader.bottom : parent.top
left: internal.portrait || iconSource == "" ? parent.left : imageLoader.right left: internal.portrait || iconSource == null ? parent.left : imageLoader.right
right: parent.right right: parent.right
bottom: parent.bottom bottom: parent.bottom
} }
elide: Text.ElideRight elide: Text.ElideRight
horizontalAlignment: !internal.portrait && iconSource != "" ? Text.AlignLeft : Text.AlignHCenter horizontalAlignment: !internal.portrait && iconSource != null ? Text.AlignLeft : Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }

View File

@ -39,6 +39,7 @@ import org.kde.plasma.core 0.1 as PlasmaCore
Item { Item {
id: main id: main
state: parent.state state: parent.state
//used to tell apart this implementation with the touch components one
property bool hasOverState: true property bool hasOverState: true
PlasmaCore.FrameSvgItem { PlasmaCore.FrameSvgItem {