Show space left bar for folderw which are mount points instead of "X items"
Needs ReviewPublic

Authored by Zren on Feb 12 2018, 6:21 AM.

Details

Reviewers
None
Group Reviewers
Dolphin
VDG
Summary

This is a WIP that I've been using on my personal branch for awhile. Figured I'd try cleaning it up and toss the diff up here.

This creates a simple rectangular progress bar overtop the "size" column/text. When there's less than 5% space left, it will use a bright red fill.

TODO

  • Need m_spaceInfoObserver(0), => m_spaceInfoObserver(nullptr),
  • Probably need m_progressBar(), => m_progressBar(nullptr), too unless that's calling an 0 param constructor there. Hmm.
  • I don't know how to properly reuse mountpointobserver.cpp, mountpointobservercache.cpp, and spaceinfoobserver.cpp. They're in dolphinstatic_SRCS and I need them in dolphinprivate_LIB_SRCS before kstandarditem.cpp is built. Do I need to have the statusbar link to the dolphinprivate_LIB_SRCS versions?
  • Colors are hardcoded. Red definitely isn't changeable, but the "outline" could be 20% from bgColor to textColor or something. The bg could be 10%. The "space filled color" could be the highlightColor. The red "you've only got <5% left" fill color is probably better to hard code though.
painter.fillRect(rect, QColor::fromRgb(230, 230, 230)); // Background
painter.setPen(QColor::fromRgb(208, 208, 208));
painter.drawRect(rect); // Outline
const QRect fillRect(rect.x(), rect.y(), rect.width() * ratio, rect.height());
if (ratio < 0.95) { // Fill
    painter.fillRect(fillRect, QColor::fromRgb(38, 160, 218));
} else {
    painter.fillRect(fillRect, QColor::fromRgb(218, 38, 38));
}

View: Details

View: Compact

View: Icons

Diff Detail

Repository
R318 Dolphin
Lint
Lint Skipped
Unit
Unit Tests Skipped
Zren created this revision.Feb 12 2018, 6:21 AM
Restricted Application added a subscriber: Dolphin. · View Herald TranscriptFeb 12 2018, 6:21 AM
Zren requested review of this revision.Feb 12 2018, 6:21 AM
ognarb added a subscriber: ognarb.May 20 2019, 9:43 PM

Hello,

overall it looks nice, but for the icon view, it looks like the progress bar overlap with the dir name. I don't really know how to resolve this problem, displaying it under the text would make the icon+text+progress bar taking to much vertical space. Maybe this information, is not as important in the icon view as in the 2 other views and shouldn't be displayed in the icon view.

Another question: how does it looks then the preview is displayed?

Last question ;) : Can this behavior be disable in the configuration?

Restricted Application added a project: Dolphin. · View Herald TranscriptMay 20 2019, 9:43 PM
Restricted Application edited subscribers, added: kfm-devel; removed: Dolphin. · View Herald Transcript