Skip to content

Commit

Permalink
Use BColorMenuItem for category selection
Browse files Browse the repository at this point in the history
  • Loading branch information
JadedCtrl authored and pulkomandy committed Mar 16, 2021
1 parent 1508bd5 commit 851e347
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/PreferenceWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <Box.h>
#include <Button.h>
#include <Catalog.h>
#include <ColorMenuItem.h>
#include <CheckBox.h>
#include <LayoutBuilder.h>
#include <PopUpMenu.h>
Expand Down Expand Up @@ -140,8 +141,8 @@ PreferenceWindow::_InitInterface()
BList* categories = fDBManager->GetAllCategories();
for (int i = 0; i < categories->CountItems(); i++) {
Category* category = (Category*)categories->ItemAt(i);
fDefaultCatMenu->AddItem(new BMenuItem(category->GetName(),
new BMessage(kDefaultCategoryChangeMessage)));
fDefaultCatMenu->AddItem(new BColorMenuItem(category->GetName(),
new BMessage(kDefaultCategoryChangeMessage), category->GetColor()));
}
fDefaultCatMenu->ItemAt(0)->SetMarked(true);
fDefaultCatMenuField = new BMenuField("DefaultCatMenu", NULL, fDefaultCatMenu);
Expand Down

0 comments on commit 851e347

Please sign in to comment.