diff --git a/backends/ui/haiku/main_window.cpp b/backends/ui/haiku/main_window.cpp index 2a20b31..b3412bc 100644 --- a/backends/ui/haiku/main_window.cpp +++ b/backends/ui/haiku/main_window.cpp @@ -165,6 +165,7 @@ HaikuLooperWindow::HaikuLooperWindow(Playback *playback) : BWindow(BRect(100, 10 delete msg; } void HaikuLooperWindow::UpdateCat(BBitmap *cat) { + LockLooper(); if (cat != NULL) { auto bounds = cat->Bounds(); auto w = bounds.Width(), h = bounds.Height(); @@ -183,10 +184,11 @@ void HaikuLooperWindow::UpdateCat(BBitmap *cat) { } } BRect dst(sw - w, sh - h, w, h); - spacer->SetViewBitmap(cat, src, dst, B_FOLLOW_RIGHT|B_FOLLOW_BOTTOM); + spacer->SetViewOverlay(cat, src, dst, NULL, B_FOLLOW_RIGHT|B_FOLLOW_BOTTOM); } else { - spacer->ClearViewBitmap(); + spacer->ClearViewOverlay(); } + UnlockLooper(); } HaikuLooperWindow::~HaikuLooperWindow() { delete ref_handler; diff --git a/backends/ui/haiku/prefs.cpp b/backends/ui/haiku/prefs.cpp index 48e2f7a..f307838 100644 --- a/backends/ui/haiku/prefs.cpp +++ b/backends/ui/haiku/prefs.cpp @@ -73,6 +73,7 @@ HaikuPrefsWindow::HaikuPrefsWindow(BLooper *next_handler) : BWindow(BRect(100, 1 BBox *box = new BBox("prefs:label_settings_box"); box->SetLabel("Labels and Icons"); auto *label_settings_group = new BGroupView(B_VERTICAL); + box->AddChild(label_settings_group); BGroupLayout *label_settings_layout = label_settings_group->GroupLayout(); BMessage *labels_only_msg = new BMessage(CMD_SET_SETTING); labels_only_msg->AddString("pref_path", "ui.haiku.label_setting"); @@ -92,6 +93,8 @@ HaikuPrefsWindow::HaikuPrefsWindow(BLooper *next_handler) : BWindow(BRect(100, 1 BMessage *cat_enable_msg = new BMessage(CMD_SET_SETTING_CHECKBOX); cat_enable_msg->AddString("pref_path", "ui.cat_enable"); cat_enable = new BCheckBox("Enable Cat", cat_enable_msg); + BBox *cat_box = new BBox("prefs:cat_options"); + cat_box->SetLabel("Cat Options"); BGroupView *cat_group = new BGroupView(B_VERTICAL); BGroupLayout *cat_layout = cat_group->GroupLayout(); for (auto &kv : cats) { @@ -116,9 +119,15 @@ HaikuPrefsWindow::HaikuPrefsWindow(BLooper *next_handler) : BWindow(BRect(100, 1 } } BRect dst(rw - w, (rh - h) / 2, rw, rh); - cat_radio->SetViewBitmap(cat_bmp, src, dst, B_FOLLOW_RIGHT|B_FOLLOW_TOP_BOTTOM); + LockLooper(); + cat_radio->SetViewOverlay(cat_bmp, src, dst, NULL, B_FOLLOW_RIGHT|B_FOLLOW_TOP_BOTTOM); + UnlockLooper(); + cat_layout->AddView(cat_radio); } root_layout->AddView(box, 3.0); + cat_box->AddChild(cat_group); + root_layout->AddView(cat_enable); + root_layout->AddView(cat_box, 3.0); BGroupView *btn_view = new BGroupView(B_HORIZONTAL); BGroupLayout *btn_box = btn_view->GroupLayout(); revert_btn = new BButton("prefs:revert", "Revert", new BMessage(CMD_REVERT)); @@ -183,7 +192,7 @@ void HaikuPrefsWindow::MessageReceived(BMessage *msg) { break; } } - cat_btns[cat_id]->SetValue(B_CONTROL_OFF); + if (cat_btns.contains(cat_id)) cat_btns[cat_id]->SetValue(B_CONTROL_OFF); cat_id = get_option("ui.cat", cats.empty() ? "" : cats.begin()->first); if (cat_btns.contains(cat_id)) cat_btns[cat_id]->SetValue(B_CONTROL_ON); enable_cat = get_option("ui.enable_cat", false);