mirror of
https://github.com/libretro/snes9x.git
synced 2024-12-13 20:22:36 +00:00
Use overscan height of 239 pixels.
Resize window on status bar visibility.
This commit is contained in:
parent
ea09396218
commit
427ef85bd3
@ -63,7 +63,7 @@ S9xSetEndianess (int type)
|
||||
double
|
||||
S9xGetAspect (void)
|
||||
{
|
||||
double native_aspect = 256.0 / (gui_config->overscan ? 240.0 : 224.0);
|
||||
double native_aspect = 256.0 / (gui_config->overscan ? 239.0 : 224.0);
|
||||
double aspect;
|
||||
|
||||
switch (gui_config->aspect_ratio)
|
||||
|
@ -100,10 +100,7 @@ event_toggle_interface (GtkWidget *widget, gpointer data)
|
||||
static gboolean
|
||||
event_show_statusbar (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
Snes9xWindow *window = (Snes9xWindow *) data;
|
||||
|
||||
window->config->statusbar_visible = !window->config->statusbar_visible;
|
||||
window->configure_widgets ();
|
||||
((Snes9xWindow *) data)->toggle_statusbar ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -1731,6 +1728,35 @@ Snes9xWindow::draw_background (int x, int y, int w, int h)
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
Snes9xWindow::toggle_statusbar (void)
|
||||
{
|
||||
GtkWidget *item;
|
||||
GtkAllocation allocation;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
|
||||
item = get_widget ("menubar");
|
||||
gtk_widget_get_allocation (item, &allocation);
|
||||
height += gtk_widget_get_visible (item) ? allocation.height : 0;
|
||||
|
||||
item = get_widget ("drawingarea");
|
||||
gtk_widget_get_allocation (item, &allocation);
|
||||
height += allocation.height;
|
||||
width = allocation.width;
|
||||
|
||||
config->statusbar_visible = !config->statusbar_visible;
|
||||
configure_widgets ();
|
||||
|
||||
item = get_widget ("statusbar");
|
||||
gtk_widget_get_allocation (item, &allocation);
|
||||
height += gtk_widget_get_visible (item) ? allocation.height : 0;
|
||||
|
||||
resize (width, height);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
Snes9xWindow::resize_viewport (int width, int height)
|
||||
{
|
||||
@ -2003,7 +2029,7 @@ Snes9xWindow::update_accels (void)
|
||||
void
|
||||
Snes9xWindow::resize_to_multiple (int factor)
|
||||
{
|
||||
int h = (config->overscan ? 240 : 224) * factor;
|
||||
int h = (config->overscan ? 239 : 224) * factor;
|
||||
int w = h * S9xGetAspect ();
|
||||
|
||||
resize_viewport (w, h);
|
||||
|
@ -53,6 +53,7 @@ class Snes9xWindow : public GtkBuilderWindow
|
||||
void show (void);
|
||||
void show_status_message (const char *message);
|
||||
void update_statusbar (void);
|
||||
void toggle_statusbar (void);
|
||||
void draw_background (int x = -1, int y = -1, int w = -1, int h = -1);
|
||||
void draw_background (cairo_t *cr);
|
||||
void set_menu_item_selected (const char *name);
|
||||
|
Loading…
Reference in New Issue
Block a user