mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-31 19:51:52 +02:00
Update to v095r11 release.
byuu says: Changelog: - SFC: "uint8 read(uint addr)" -> "uint8 read(uint addr, uint8 data)" - hiro: mHorizontalLayout::setGeometry() return value - hiro/GTK: ListView,TreeView::setFocused() does not grab focus of first item Notes: - nall/windows/utf8.hpp needs using uint = unsigned; at the top to compile - sfc/balanced, sfc/performance won't compile yet Seems Cx4 games broke a while back. Not from this WIP, either. I'll go back and find out what's wrong now.
This commit is contained in:
@@ -119,7 +119,13 @@ auto pListView::setBordered(bool bordered) -> void {
|
||||
}
|
||||
|
||||
auto pListView::setFocused() -> void {
|
||||
//gtk_widget_grab_focus() will select the first item if nothing is currently selected
|
||||
//this behavior is undesirable. detect selection state first, and restore if required
|
||||
lock();
|
||||
bool selected = gtk_tree_selection_get_selected(gtkTreeSelection, nullptr, nullptr);
|
||||
gtk_widget_grab_focus(gtkWidgetChild);
|
||||
if(!selected) gtk_tree_selection_unselect_all(gtkTreeSelection);
|
||||
unlock();
|
||||
}
|
||||
|
||||
auto pListView::setFont(const Font& font) -> void {
|
||||
|
@@ -79,6 +79,16 @@ auto pTreeView::setBackgroundColor(Color color) -> void {
|
||||
gtk_widget_modify_base(gtkWidgetChild, GTK_STATE_NORMAL, color ? &gdkColor : nullptr);
|
||||
}
|
||||
|
||||
auto pTreeView::setFocused() -> void {
|
||||
//gtk_widget_grab_focus() will select the first item if nothing is currently selected
|
||||
//this behavior is undesirable. detect selection state first, and restore if required
|
||||
lock();
|
||||
bool selected = gtk_tree_selection_get_selected(gtkTreeSelection, nullptr, nullptr);
|
||||
gtk_widget_grab_focus(gtkWidgetChild);
|
||||
if(!selected) gtk_tree_selection_unselect_all(gtkTreeSelection);
|
||||
unlock();
|
||||
}
|
||||
|
||||
auto pTreeView::setForegroundColor(Color color) -> void {
|
||||
auto gdkColor = CreateColor(color);
|
||||
gtk_widget_modify_text(gtkWidgetChild, GTK_STATE_NORMAL, color ? &gdkColor : nullptr);
|
||||
|
@@ -8,6 +8,7 @@ struct pTreeView : pWidget {
|
||||
auto append(sTreeViewItem item) -> void;
|
||||
auto remove(sTreeViewItem item) -> void;
|
||||
auto setBackgroundColor(Color color) -> void;
|
||||
auto setFocused() -> void override;
|
||||
auto setForegroundColor(Color color) -> void;
|
||||
|
||||
auto _activatePath(GtkTreePath* gtkPath) -> void;
|
||||
|
Reference in New Issue
Block a user