mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
Merge branch 'Applications/16.12'
This commit is contained in:
commit
5107523249
|
@ -307,7 +307,7 @@ void DolphinContextMenu::openItemContextMenu()
|
|||
if (selectedUrl.isValid()) {
|
||||
PlacesItemModel model;
|
||||
const QString text = selectedUrl.fileName();
|
||||
PlacesItem* item = model.createPlacesItem(text, selectedUrl);
|
||||
PlacesItem* item = model.createPlacesItem(text, selectedUrl, KIO::iconNameForUrl(selectedUrl));
|
||||
model.appendItemToGroup(item);
|
||||
model.saveBookmarks();
|
||||
}
|
||||
|
@ -373,7 +373,8 @@ void DolphinContextMenu::openViewportContextMenu()
|
|||
if (container->url().isValid()) {
|
||||
PlacesItemModel model;
|
||||
PlacesItem* item = model.createPlacesItem(container->placesText(),
|
||||
container->url());
|
||||
container->url(),
|
||||
KIO::iconNameForUrl(container->url()));
|
||||
model.appendItemToGroup(item);
|
||||
model.saveBookmarks();
|
||||
}
|
||||
|
|
|
@ -211,19 +211,7 @@ void DolphinView::setActive(bool active)
|
|||
|
||||
m_active = active;
|
||||
|
||||
QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
|
||||
if (!active) {
|
||||
color.setAlpha(150);
|
||||
}
|
||||
|
||||
QWidget* viewport = m_container->viewport();
|
||||
if (viewport) {
|
||||
QPalette palette;
|
||||
palette.setColor(viewport->backgroundRole(), color);
|
||||
viewport->setPalette(palette);
|
||||
}
|
||||
|
||||
update();
|
||||
updatePalette();
|
||||
|
||||
if (active) {
|
||||
m_container->setFocus();
|
||||
|
@ -721,9 +709,30 @@ void DolphinView::stopLoading()
|
|||
m_model->cancelDirectoryLoading();
|
||||
}
|
||||
|
||||
void DolphinView::updatePalette()
|
||||
{
|
||||
QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
|
||||
if (!m_active) {
|
||||
color.setAlpha(150);
|
||||
}
|
||||
|
||||
QWidget* viewport = m_container->viewport();
|
||||
if (viewport) {
|
||||
QPalette palette;
|
||||
palette.setColor(viewport->backgroundRole(), color);
|
||||
viewport->setPalette(palette);
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
bool DolphinView::eventFilter(QObject* watched, QEvent* event)
|
||||
{
|
||||
switch (event->type()) {
|
||||
case QEvent::PaletteChange:
|
||||
updatePalette();
|
||||
break;
|
||||
|
||||
case QEvent::KeyPress:
|
||||
if (GeneralSettings::useTabForSwitchingSplitView()) {
|
||||
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
|
||||
|
|
|
@ -762,6 +762,8 @@ private:
|
|||
QUrl viewPropertiesUrl() const;
|
||||
|
||||
private:
|
||||
void updatePalette();
|
||||
|
||||
bool m_active;
|
||||
bool m_tabsForFiles;
|
||||
bool m_assureVisibleCurrentIndex;
|
||||
|
|
Loading…
Reference in a new issue