Procházet zdrojové kódy

Folder Status: Use same fat ... icon as web

Markus Goetz před 10 roky
rodič
revize
4784b327e7
4 změnil soubory, kde provedl 10 přidání a 1 odebrání
  1. 1 0
      client.qrc
  2. binární
      resources/more.png
  3. 7 1
      src/gui/folderstatusdelegate.cpp
  4. 2 0
      src/gui/folderstatusdelegate.h

+ 1 - 0
client.qrc

@@ -20,5 +20,6 @@
         <file>resources/lock-https.png</file>
         <file>resources/lock-https@2x.png</file>
         <file>resources/account.png</file>
+        <file>resources/more.png</file>
     </qresource>
 </RCC>

binární
resources/more.png


+ 7 - 1
src/gui/folderstatusdelegate.cpp

@@ -28,6 +28,10 @@
 
 namespace OCC {
 
+FolderStatusDelegate::FolderStatusDelegate() : QStyledItemDelegate() {
+    m_moreIcon = QIcon(QPixmap(Theme::hidpiFileName(":/client/resources/more.png")));
+}
+
 QString FolderStatusDelegate::addFolderText()
 {
     return tr("Add Folder Sync Connection");
@@ -324,13 +328,15 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
 
     {
         QStyleOptionToolButton btnOpt;
-        btnOpt.text = QLatin1String("...");
+        //btnOpt.text = QLatin1String("...");
         btnOpt.state = option.state;
         btnOpt.state &= ~(QStyle::State_Selected | QStyle::State_HasFocus);
         btnOpt.state |= QStyle::State_Raised;
         btnOpt.arrowType = Qt::NoArrow;
         btnOpt.subControls = QStyle::SC_ToolButton;
         btnOpt.rect = optionsButtonRect(option.rect);
+        btnOpt.icon = m_moreIcon;
+        btnOpt.iconSize = btnOpt.rect.size();
         QApplication::style()->drawComplexControl( QStyle::CC_ToolButton, &btnOpt, painter );
     }
 }

+ 2 - 0
src/gui/folderstatusdelegate.h

@@ -26,6 +26,8 @@ class FolderStatusDelegate : public QStyledItemDelegate
 {
     Q_OBJECT
 public:
+    QIcon m_moreIcon;
+    FolderStatusDelegate();
 
     enum datarole { FolderAliasRole = Qt::UserRole + 100,
                     HeaderRole,