D10453: Show space left bar for folderw which are mount points instead of "X items"

Chris Holland noreply at phabricator.kde.org
Mon Feb 12 06:21:57 GMT 2018


Zren created this revision.
Restricted Application added a subscriber: Dolphin.
Zren requested review of this revision.

REVISION 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
  
  F5706396: 2018-02-12___00-58-53.png <https://phabricator.kde.org/F5706396>
  
  View: Compact
  
  F5706398: 2018-02-12___00-59-48.png <https://phabricator.kde.org/F5706398>
  
  View: Icons
  
  F5706399: 2018-02-12___01-00-36.png <https://phabricator.kde.org/F5706399>

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D10453

AFFECTED FILES
  src/CMakeLists.txt
  src/kitemviews/kstandarditemlistwidget.cpp
  src/kitemviews/kstandarditemlistwidget.h
  src/kitemviews/mountpointobserver.cpp
  src/kitemviews/mountpointobserver.h
  src/kitemviews/mountpointobservercache.cpp
  src/kitemviews/mountpointobservercache.h
  src/kitemviews/spaceinfoobserver.cpp
  src/kitemviews/spaceinfoobserver.h

To: Zren
Cc: #dolphin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180212/99fce973/attachment.htm>


More information about the kfm-devel mailing list