21 #ifndef PCMANFM_DESKTOPWINDOW_H 22 #define PCMANFM_DESKTOPWINDOW_H 26 #include <unordered_map> 33 #include <libfm-qt/core/folder.h> 36 class CachedFolderModel;
37 class ProxyFolderModel;
38 class FolderViewListView;
62 void setForeground(
const QColor& color);
63 void setShadow(
const QColor& color);
64 void setBackground(
const QColor& color);
65 void setDesktopFolder();
66 void setWallpaperFile(QString filename);
67 void setWallpaperMode(WallpaperMode mode = WallpaperStretch);
68 void setLastSlide(QString filename);
69 void setWallpaperDir(QString dirname);
70 void setSlideShowInterval(
int interval);
71 void setWallpaperRandomize(
bool randomize);
74 void updateWallpaper();
77 void updateFromSettings(
Settings& settings,
bool changeSlide =
true);
79 void queueRelayout(
int delay = 0);
81 int screenNum()
const {
85 void setScreenNum(
int num);
88 virtual void prepareFolderMenu(Fm::FolderMenu* menu)
override;
89 virtual void prepareFileMenu(Fm::FileMenu* menu)
override;
90 virtual void resizeEvent(QResizeEvent* event)
override;
91 virtual void onFileClicked(
int type,
const std::shared_ptr<const Fm::FileInfo>& fileInfo)
override;
93 void loadItemPositions();
94 void saveItemPositions();
96 QImage loadWallpaperFile(QSize requiredSize);
98 virtual bool event(QEvent* event)
override;
99 virtual bool eventFilter(QObject* watched, QEvent* event)
override;
101 virtual void childDropEvent(QDropEvent* e)
override;
102 virtual void closeEvent(QCloseEvent* event)
override;
103 virtual void paintEvent(QPaintEvent *event)
override;
106 void onOpenDirRequested(
const Fm::FilePath& path,
int target);
107 void onDesktopPreferences();
109 void onRowsAboutToBeRemoved(
const QModelIndex& parent,
int start,
int end);
110 void onRowsInserted(
const QModelIndex& parent,
int start,
int end);
111 void onLayoutChanged();
112 void onModelSortFilterChanged();
113 void onIndexesMoved(
const QModelIndexList& indexes);
114 void onDataChanged(
const QModelIndex& topLeft,
const QModelIndex& bottomRight);
116 void relayoutItems();
117 void onStickToCurrentPos(
bool toggled);
122 void onCutActivated();
123 void onCopyActivated();
124 void onPasteActivated();
125 void onRenameActivated();
126 void onDeleteActivated();
127 void onFilePropertiesActivated();
130 void removeBottomGap();
131 void paintBackground(QPaintEvent* event);
132 static void alignToGrid(QPoint& pos,
const QPoint& topLeft,
const QSize& grid,
const int spacing);
135 Fm::ProxyFolderModel* proxyModel_;
136 Fm::CachedFolderModel* model_;
137 std::shared_ptr<Fm::Folder> folder_;
138 Fm::FolderViewListView* listView_;
143 QString wallpaperFile_;
144 WallpaperMode wallpaperMode_;
146 QString wallpaperDir_;
147 int slideShowInterval_;
148 QTimer* wallpaperTimer_;
149 bool wallpaperRandomize_;
150 QPixmap wallpaperPixmap_;
155 std::unordered_map<std::string, QPoint> customItemPos_;
156 QHash<QModelIndex, QString> displayNames_;
157 QTimer* relayoutTimer_;
162 #endif // PCMANFM_DESKTOPWINDOW_H Definition: desktopwindow.h:35
Definition: application.h:56
Definition: settings.h:121
Definition: application.cpp:59
Definition: launcher.h:30
Definition: desktopwindow.h:45