Merge remote-tracking branch 'origin/KDE/4.13'

This commit is contained in:
Frank Reininghaus 2014-03-05 08:46:45 +01:00
commit 8dcd8eab8d
18 changed files with 52 additions and 37 deletions

View file

@ -538,11 +538,10 @@ bool KItemListController::mousePressEvent(QGraphicsSceneMouseEvent* event, const
m_pressedIndex = m_view->itemAt(m_pressedMousePos);
emit mouseButtonPressed(m_pressedIndex, event->buttons());
if ((event->buttons() & (Qt::XButton1 | Qt::XButton2)) && m_pressedIndex < 0) {
// Do not select items when clicking the empty part of the view with
// the back/forward buttons, see https://bugs.kde.org/show_bug.cgi?id=327412.
// Note that clicking an item with these buttons selects it, see comment in
// DolphinView::slotMouseButtonPressed(int, Qt::MouseButtons).
// TODO: Qt5: Replace Qt::XButton1 by Qt::BackButton and Qt::XButton2 by Qt::ForwardButton
if (event->buttons() & (Qt::XButton1 | Qt::XButton2)) {
// Do not select items when clicking the back/forward buttons, see
// https://bugs.kde.org/show_bug.cgi?id=327412.
return true;
}
@ -952,8 +951,13 @@ bool KItemListController::hoverMoveEvent(QGraphicsSceneHoverEvent* event, const
if (newHoveredWidget) {
newHoveredWidget->setHovered(true);
const QPointF mappedPos = newHoveredWidget->mapFromItem(m_view, pos);
newHoveredWidget->setHoverPosition(mappedPos);
emit itemHovered(newHoveredWidget->index());
}
} else if (oldHoveredWidget) {
const QPointF mappedPos = oldHoveredWidget->mapFromItem(m_view, pos);
oldHoveredWidget->setHoverPosition(mappedPos);
}
return false;

View file

@ -279,6 +279,13 @@ bool KItemListWidget::isHovered() const
return m_hovered;
}
void KItemListWidget::setHoverPosition(const QPointF& pos)
{
if (m_selectionToggle) {
m_selectionToggle->setHovered(m_selectionToggle->contains(pos));
}
}
void KItemListWidget::setAlternateBackground(bool enable)
{
if (m_alternateBackground != enable) {

View file

@ -108,6 +108,8 @@ public:
void setHovered(bool hovered);
bool isHovered() const;
void setHoverPosition(const QPointF& pos);
void setAlternateBackground(bool enable);
bool alternateBackground() const;

View file

@ -30,7 +30,6 @@ KItemListSelectionToggle::KItemListSelectionToggle(QGraphicsItem* parent) :
m_checked(false),
m_hovered(false)
{
setAcceptHoverEvents(true);
}
KItemListSelectionToggle::~KItemListSelectionToggle()
@ -51,6 +50,15 @@ bool KItemListSelectionToggle::isChecked() const
return m_checked;
}
void KItemListSelectionToggle::setHovered(bool hovered)
{
if (m_hovered != hovered) {
m_hovered = hovered;
m_pixmap = QPixmap();
update();
}
}
void KItemListSelectionToggle::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
{
Q_UNUSED(option);
@ -65,20 +73,6 @@ void KItemListSelectionToggle::paint(QPainter* painter, const QStyleOptionGraphi
painter->drawPixmap(x, y, m_pixmap);
}
void KItemListSelectionToggle::hoverEnterEvent(QGraphicsSceneHoverEvent* event)
{
QGraphicsWidget::hoverEnterEvent(event);
m_hovered = true;
m_pixmap = QPixmap();
}
void KItemListSelectionToggle::hoverLeaveEvent(QGraphicsSceneHoverEvent* event)
{
QGraphicsWidget::hoverLeaveEvent(event);
m_hovered = false;
m_pixmap = QPixmap();
}
void KItemListSelectionToggle::resizeEvent(QGraphicsSceneResizeEvent* event)
{
QGraphicsWidget::resizeEvent(event);
@ -97,12 +91,9 @@ void KItemListSelectionToggle::resizeEvent(QGraphicsSceneResizeEvent* event)
void KItemListSelectionToggle::updatePixmap()
{
const char* icon = m_checked ? "list-remove" : "list-add";
m_pixmap = KIconLoader::global()->loadIcon(QLatin1String(icon), KIconLoader::NoGroup, iconSize());
if (m_hovered) {
KIconLoader::global()->iconEffect()->apply(m_pixmap, KIconLoader::Desktop, KIconLoader::ActiveState);
}
const QString icon = m_checked ? "list-remove" : "list-add";
const KIconLoader::States state = m_hovered ? KIconLoader::ActiveState : KIconLoader::DisabledState;
m_pixmap = KIconLoader::global()->loadIcon(icon, KIconLoader::Desktop, iconSize(), state);
}
int KItemListSelectionToggle::iconSize() const

View file

@ -41,11 +41,11 @@ public:
void setChecked(bool checked);
bool isChecked() const;
void setHovered(bool hovered);
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
protected:
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* event);
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* event);
virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
private:

View file

@ -1046,6 +1046,7 @@ void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even
if (op && destUrl == url()) {
// Mark the dropped urls as selected.
m_clearSelectionBeforeSelectingNewItems = true;
m_markFirstNewlySelectedItemAsCurrent = true;
connect(op, SIGNAL(aboutToCreate(KUrl::List)), this, SLOT(slotAboutToCreate(KUrl::List)));
}
@ -1070,17 +1071,15 @@ void DolphinView::slotModelChanged(KItemModelBase* current, KItemModelBase* prev
void DolphinView::slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons)
{
Q_UNUSED(itemIndex);
hideToolTip();
if (itemIndex < 0) {
// Trigger the history navigation only when clicking on the viewport:
// Above an item the XButtons provide a simple way to select items in
// the singleClick mode.
if (buttons & Qt::XButton1) {
emit goBackRequested();
} else if (buttons & Qt::XButton2) {
emit goForwardRequested();
}
// TODO: Qt5: Replace Qt::XButton1 by Qt::BackButton and Qt::XButton2 by Qt::ForwardButton
if (buttons & Qt::XButton1) {
emit goBackRequested();
} else if (buttons & Qt::XButton2) {
emit goForwardRequested();
}
}

View file

@ -96,6 +96,7 @@ Comment[kk]=Google-дің көмегімен ашылған бетті басқ
Comment[ko]=Google
Comment[lt]=Šio puslapio kalbos vertimas naudojant Google
Comment[nb]=Språkoversettelse for gjeldende side, ved bruk av Google
Comment[nds]=Översetten vun de aktuelle Nettsiet mit Google
Comment[nl]=Vertaalt de huidige webpagina met behulp van Google
Comment[pa]=
Comment[pl]=Tłumaczenia dla bieżącej strony przy użyciu Google

View file

@ -24,6 +24,7 @@ Name[ko]=UADescription (Google 크롬 22.0)
Name[lt]=NA Aprašymas (Google Chrome 22.0)
Name[mr]=UAिि (Google Chrome 22.0)
Name[nb]=Brukeragent (Google Chrome 22.0)
Name[nds]=UA-Beschrieven (Google Chrome 22.0)
Name[nl]=GA-beschrijving (Google Chrome 22.0)
Name[pa]=UADescription ( .)
Name[pl]=Opis przeglądarki użytkownika (Google Chrome 22.0)

View file

@ -24,6 +24,7 @@ Name[ko]=UADescription (Google 크롬 23.0)
Name[lt]=NA Aprašymas (Google Chrome 23.0)
Name[mr]=UAिि (Google Chrome 23.0)
Name[nb]=Brukeragent (Google Chrome 23.0)
Name[nds]=UA-Beschrieven (Google Chrome 23.0)
Name[nl]=GA-beschrijving (Google Chrome 23.0)
Name[pa]=UADescription ( .)
Name[pl]=Opis przeglądarki użytkownika (Google Chrome 23.0)

View file

@ -24,6 +24,7 @@ Name[ko]=UADescription (Google 크롬 24.0)
Name[lt]=NA Aprašymas (Google Chrome 24.0)
Name[mr]=UAिि (Google Chrome 24.0)
Name[nb]=Brukeragent (Google Chrome 24.0)
Name[nds]=UA-Beschrieven (Google Chrome 24.0)
Name[nl]=GA-beschrijving (Google Chrome 24.0)
Name[pa]=UADescription ( .)
Name[pl]=Opis przeglądarki użytkownika (Google Chrome 24.0)

View file

@ -24,6 +24,7 @@ Name[ko]=UADescription (현재 플랫폼의 Firefox 15)
Name[lt]=NA Aprašymas (Firefox 15 iki naujausios)
Name[mr]=UAिि ( 15 )
Name[nb]=Brukeragent (Firefox 15 herifra)
Name[nds]=UA-Beschrieven (Firefox 15 op dit Systeem)
Name[nl]=GA-beschrijving (Firefox 15 op huidige)
Name[pa]=UADescription ( 15)
Name[pl]=Opis przeglądarki użytkownika (Firefox 15, na bieżącym systemie)

View file

@ -24,6 +24,7 @@ Name[ko]=UADescription (현재 플랫폼의 Firefox 16)
Name[lt]=NA Aprašymas (Firefox 16 iki naujausios)
Name[mr]=UAिि ( 16 )
Name[nb]=Brukeragent (Firefox 16 herifra)
Name[nds]=UA-Beschrieven (Firefox 16 op dit Systeem)
Name[nl]=UADescription (Firefox 16 op huidige)
Name[pa]=UADescription ( 16)
Name[pl]=Opis przeglądarki użytkownika (Firefox 16, na bieżącym systemie)

View file

@ -24,6 +24,7 @@ Name[ko]=UADescription (Windows Vista의 IE 8.0)
Name[lt]=NA Aprašymas (IE 8.0, Windows Vista)
Name[mr]=UAिि (IE 8.0 ि ि )
Name[nb]=Brukeragent (IE 8.0 på Windows Vista)
Name[nds]=UA-Beschrieven (IE 8.0 op Windows Vista)
Name[nl]=GA-beschrijving (IE 8.0 op Windows Vista)
Name[pa]=UADescription (ਿ XP IE 8.0)
Name[pl]=Opis przeglądarki użytkownika (IE 8.0 na Windows Vista)

View file

@ -24,6 +24,7 @@ Name[ko]=UADescription (Windows 7의 IE 9.0)
Name[lt]=NA Aprašymas (IE 9.0, Windows 7)
Name[mr]=UAिि (IE 9.0 ि )
Name[nb]=Brukeragent (IE 9.0 på Windows Seven)
Name[nds]=UA-Beschrieven (IE 9.0 op Windows Seven)
Name[nl]=GA-beschrijving (IE 9.0 op Windows 7)
Name[pa]=UADescription (ਿ XP IE 9.0)
Name[pl]=Opis przeglądarki użytkownika (IE 9.0 na Windows Vista)

View file

@ -24,6 +24,7 @@ Name[ko]=UADescription (현재 플랫폼의 Opera 11.62)
Name[lt]=NA Aprašymas (Opera 11.62 iki naujausios)
Name[mr]=UAिि ( 11.62 )
Name[nb]=Brukeragent (Opera 11.62 herifra)
Name[nds]=UA-Beschrieven (Opera 11.62 op dit Systeem)
Name[nl]=GA-beschrijving (Opera 11.62 op huidige)
Name[pa]=UADescription ( 11.62)
Name[pl]=Opis przeglądarki użytkownika (Opera 11.62 na bieżącym systemie)

View file

@ -24,6 +24,7 @@ Name[ko]=UADescription (현재 플랫폼의 Opera 12.02)
Name[lt]=NA Aprašymas (Opera 12.02 iki naujausios)
Name[mr]=UAिि ( 12.02 )
Name[nb]=Brukeragent (Opera 12.02 herifra)
Name[nds]=UA-Beschrieven (Opera 12.02 op dit Systeem)
Name[nl]=GA-beschrijving (Opera 12.02 op huidige)
Name[pa]=UADescription ( 12.02)
Name[pl]=Opis przeglądarki użytkownika (Opera 12.02 na bieżącym systemie)

View file

@ -24,6 +24,7 @@ Name[ko]=UADescription (Mac OS X의 Safari 5.1.7)
Name[lt]=NA Aprašymas (Safari 5.1.7, MacOS X)
Name[mr]=UAिि (- X 5.1.7)
Name[nb]=Brukeragent (Safari 5.1.7 på MacOS X)
Name[nds]=UA-Beschrieven (Safari 5.1.7 op MacOS X)
Name[nl]=GA-beschrijving (Safari 5.1.7 op MacOS X)
Name[pa]=UADescription (MacOS X 5.1.7)
Name[pl]=Opis przeglądarki użytkownika (Safari 5.1.7 na MacOS X)

View file

@ -24,6 +24,7 @@ Name[ko]=UADescription (Mac OS X의 Safari 6.0)
Name[lt]=NA Aprašymas (Safari 6.0, MacOS X)
Name[mr]=UAिि (- X 6.0)
Name[nb]=Brukeragent (Safari 6.0 på MacOS X)
Name[nds]=UA-Beschrieven (Safari 6.0 op MacOS X)
Name[nl]=GA-beschrijving (Safari 6.0 op MacOS X)
Name[pa]=UADescription (MacOS X 6.0)
Name[pl]=Opis przeglądarki użytkownika (Safari 6.0 na MacOS X)