-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileList.h
More file actions
85 lines (64 loc) · 2.18 KB
/
FileList.h
File metadata and controls
85 lines (64 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#pragma once
#include <gtkmm.h>
#include <gtkmm/window.h>
#include <vector>
#include "FileEntry.h"
#include "PropertiesDialog.h"
//define icons
#define FILE_TYPE_FILE_ICON "text-x-generic"
#define FILE_TYPE_DIRECTORY_ICON "folder"
class FileList{
public:
FileList(Gtk::Container* window,Glib::RefPtr<Gtk::Builder> builder);
// update the entries currently shown. The file entries in the vector will be copied, so they can be destroyed after this function finished
void updateFiles(std::vector<FileEntry*> entries);
void clearList();
//void onEntryDoubleClicked(Gtk::Button* button, GdkEventButton* event, FileEntry* entry);
//void onEntryClicked(Gtk::Button* button, FileEntry* entry);
void onFrameClicked();
void onKeyPressed(GdkEventKey* key);
void onKeyReleased(GdkEventKey* key);
void setSearchCallback(void (*onSearch)(void*,std::string), void* manager);
void onSearch();
std::vector<FileEntry*> getSelectedEntries();
Gtk::Label* currentPathLabel;
std::vector<std::pair<FileEntry*,Gtk::Button*>> selectedEntries;
//std::vector<std::pair<FileEntry,Gtk::Button*>> shownEntries;
Gtk::ScrolledWindow* listScroller;
Gtk::ScrolledWindow* pathScroller;
private:
Gtk::Container* parent;
Gtk::Frame* frame;
Gtk::Label* label;
Gtk::Box* listBox;
Gtk::Box* internalLayoutBox;
Gtk::Box* controlBox;
Gtk::SearchEntry* searchBar;
// context menu stuff
Gtk::Menu* contextMenu;
Gtk::MenuItem* propertiesMenuItem;
//Gtk::Button* goUpButton;
//properties dialog
std::unique_ptr<PropertiesDialog> propDialog;
void onResize();
void setupModelStuff();
Gtk::EventBox* evtBox;
Glib::RefPtr<Gtk::Builder> builder;
Glib::RefPtr<Gtk::CssProvider> cssProvider;
std::pair<FileEntry*,Gtk::Button*> activeEntry;
// TreeView Stuff
Gtk::TreeModel::ColumnRecord cRecord;
Gtk::TreeViewColumn mainViewColumn;
Gtk::TreeModelColumn<std::string> iconColumn;
Gtk::TreeModelColumn<std::string> nameColumn;
Gtk::TreeModelColumn<FileEntry*> entryColumn;
Glib::RefPtr<Gtk::ListStore> store;
Gtk::TreeView treeView;
Gtk::CellRendererPixbuf crPixbuf;
Gtk::CellRendererText crText;
void (*onSearchCallback)(void*,std::string);
void* manager;
void* propNode;
bool shiftPressed;
bool ctrlPressed;
};