WidgetGallery: Make custom cursors visible only in the cursors tab

Prior to this change, the selected cursor stayed changed throughout
the app, even after switching tabs, which didn't look quite right.
This commit is contained in:
Karol Kosek 2021-11-06 22:22:26 +01:00 committed by Andreas Kling
commit 657409736a
Notes: sideshowbarker 2024-07-18 01:25:30 +09:00

View file

@ -306,7 +306,7 @@ GalleryWidget::GalleryWidget()
m_cursors_tableview->on_activation = [&](const GUI::ModelIndex& index) {
auto icon_index = index.model()->index(index.row(), MouseCursorModel::Column::Bitmap);
window()->set_cursor(icon_index.data().as_bitmap());
m_cursors_tableview->set_override_cursor(NonnullRefPtr<Gfx::Bitmap>(icon_index.data().as_bitmap()));
};
auto& icons_tab = tab_widget.add_tab<GUI::Widget>("Icons");