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,12 +71,16 @@ public:
void mousePressEvent(QMouseEvent *event)
{
event->accept();
m_dialog->view()->winId();
KWindowSystem::forceActiveWindow(m_dialog->view()->winId());
}
void mouseReleaseEvent(QMouseEvent *event)
{
if (!m_dialog->view()->geometry().contains(event->globalPos())) {
m_dialog->close();
}
}
private:
FullScreenDialog *m_dialog;
@ -249,13 +253,23 @@ void FullScreenDialog::setVisible(const bool visible)
{
if (m_view->isVisible() != visible) {
m_background->setVisible(visible);
Plasma::WindowEffects::slideWindow(m_view->winId(), Plasma::BottomEdge, 0);
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) {
m_view->raise();
KWindowSystem::forceActiveWindow(m_view->effectiveWinId());
}
}
}
QGraphicsView *FullScreenDialog::view() const
{
return m_view;
}
QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::title()
{
if (m_rootObject) {
@ -339,10 +353,6 @@ bool FullScreenDialog::eventFilter(QObject *watched, QEvent *event)
if (watched == m_mainItem.data() &&
(event->type() == QEvent::GraphicsSceneResize)) {
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;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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