Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/listitem.cc7
-rw-r--r--src/ui/listitem.h12
2 files changed, 15 insertions, 4 deletions
diff --git a/src/ui/listitem.cc b/src/ui/listitem.cc
index dfe0c0e..a5d033a 100644
--- a/src/ui/listitem.cc
+++ b/src/ui/listitem.cc
@@ -47,11 +47,10 @@ void ListItem::draw()
if (!text().size())
return;
- if (has_mouse_focus() || ((static_cast<ListView *>(parent()))->selected() == this)) {
- Paint::set_color(palette()->highlight());
-
- } else if (disabled()) {
+ if (disabled()) {
Paint::set_color(palette()->disabled());
+ } else if (((static_cast<ListView *>(parent()))->selected() == this)) {
+ Paint::set_color(palette()->highlight());
} else {
Paint::set_color(palette()->foreground());
}
diff --git a/src/ui/listitem.h b/src/ui/listitem.h
index 5795917..a0f4d5e 100644
--- a/src/ui/listitem.h
+++ b/src/ui/listitem.h
@@ -27,6 +27,7 @@ public:
ListItem(ListView *parent, const char * text);
~ListItem();
+ // info record associated with this list item
inline const core::Info *info() const {
return listitem_info;
}
@@ -35,10 +36,16 @@ public:
return listitem_item;
}
+ // sort key for this list item
inline const std::string & sortkey() const {
return listitem_sortkey;
}
+ // string value associated with this list item
+ inline const std::string & value() const {
+ return listitem_value;
+ }
+
inline void set_info(const core::Info *info) {
listitem_info = info;
}
@@ -50,6 +57,10 @@ public:
inline void set_sortkey(const std::string sortkey) {
listitem_sortkey.assign(sortkey);
}
+
+ inline void set_value(const std::string value) {
+ listitem_value.assign(value);
+ }
void select();
@@ -68,6 +79,7 @@ private:
const core::Info *listitem_info;
const core::Item *listitem_item;
std::string listitem_sortkey;
+ std::string listitem_value;
};
} // namespace ui