From 3dd4d34239a00a71df3638d148bfe92047ac7921 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 4 Jun 2011 21:25:33 +0300 Subject: Add support for colors to shortcuts panel. --- src/itemshortcut.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/itemshortcut.h') diff --git a/src/itemshortcut.h b/src/itemshortcut.h index ee59a27ac..b735e899c 100644 --- a/src/itemshortcut.h +++ b/src/itemshortcut.h @@ -63,6 +63,9 @@ class ItemShortcut int getItem(int index) const { return mItems[index]; } + unsigned char getItemColor(int index) const + { return mItemColors[index]; } + /** * Returns the amount of shortcut items. */ @@ -80,8 +83,7 @@ class ItemShortcut * * @param index Index of the items. */ - void setItem(int index) - { mItems[index] = mItemSelected; save(); } + void setItem(int index); /** * Adds an item to the items store specified by the index. @@ -89,8 +91,8 @@ class ItemShortcut * @param index Index of the item. * @param itemId ID of the item. */ - void setItems(int index, int itemId) - { mItems[index] = itemId; save(); } + void setItems(int index, int itemId, unsigned char color) + { mItems[index] = itemId; mItemColors[index] = color; save(); } /** * Set the item that is selected. @@ -100,6 +102,8 @@ class ItemShortcut void setItemSelected(int itemId) { mItemSelected = itemId; } + void setItemSelected(Item *item); + /** * Returns selected shortcut item ID. */ @@ -137,8 +141,10 @@ class ItemShortcut private: - int mItems[SHORTCUT_ITEMS]; /**< The items stored. */ - int mItemSelected; /**< The item held by cursor. */ + int mItems[SHORTCUT_ITEMS]; /**< The items. */ + unsigned char mItemColors[SHORTCUT_ITEMS]; /**< The item colors. */ + int mItemSelected; + int mItemColorSelected; int mNumber; }; -- cgit v1.2.3-70-g09d2