mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Merge remote-tracking branch 'origin/KDE/4.13'
This commit is contained in:
commit
8dcd8eab8d
18 changed files with 52 additions and 37 deletions
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -108,6 +108,8 @@ public:
|
|||
void setHovered(bool hovered);
|
||||
bool isHovered() const;
|
||||
|
||||
void setHoverPosition(const QPointF& pos);
|
||||
|
||||
void setAlternateBackground(bool enable);
|
||||
bool alternateBackground() const;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue