mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:08:11 +00:00
LibGUI: Add a GItemView class.
This is a GAbstractView subclass that implements a icon-based view onto a GModel. It still need a bunch of work, but it's in basic usable shape.
This commit is contained in:
parent
5707d7f547
commit
19fa70c821
16 changed files with 361 additions and 47 deletions
|
@ -165,11 +165,15 @@ GVariant DirectoryModel::data(const GModelIndex& index, Role role) const
|
|||
case Column::Inode: return (int)entry.inode;
|
||||
}
|
||||
}
|
||||
if (role == Role::Icon) {
|
||||
return icon_for(entry);
|
||||
}
|
||||
return { };
|
||||
}
|
||||
|
||||
void DirectoryModel::update()
|
||||
{
|
||||
dbgprintf("DirectoryModel::update\n");
|
||||
DIR* dirp = opendir(m_path.characters());
|
||||
if (!dirp) {
|
||||
perror("opendir");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue