mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-30 18:23:08 +03:00
[project @ 2004-08-30 21:57:47 by rjw]
Various small theme related fixes svn path=/import/netsurf/; revision=1256
This commit is contained in:
parent
c6ffb4b578
commit
98d17f19a6
@ -565,6 +565,7 @@ void ro_gui_dialog_config_set(void) {
|
||||
|
||||
void ro_gui_dialog_click_config(wimp_pointer *pointer)
|
||||
{
|
||||
wimp_window_state state;
|
||||
switch (pointer->i) {
|
||||
case ICON_CONFIG_SAVE:
|
||||
ro_gui_dialog_config_set();
|
||||
@ -601,8 +602,26 @@ void ro_gui_dialog_click_config(wimp_pointer *pointer)
|
||||
ro_gui_set_icon_selected_state(dialog_config,
|
||||
ICON_CONFIG_THEME, true);
|
||||
ro_gui_open_pane(dialog_config, dialog_config_th, 0);
|
||||
ro_gui_open_pane(dialog_config_th,
|
||||
dialog_config_th_pane, 12);
|
||||
state.w = dialog_config_th;
|
||||
xwimp_get_window_state(&state);
|
||||
state.w = dialog_config_th_pane;
|
||||
state.visible.x0 += 12;
|
||||
state.visible.x1 -= 12;
|
||||
state.visible.y0 += 128;
|
||||
state.visible.y1 -= 12;
|
||||
xwimp_open_window_nested((wimp_open *) &state, dialog_config_th,
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
|
||||
<< wimp_CHILD_XORIGIN_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
|
||||
<< wimp_CHILD_YORIGIN_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
|
||||
<< wimp_CHILD_LS_EDGE_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
|
||||
<< wimp_CHILD_BS_EDGE_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
|
||||
<< wimp_CHILD_RS_EDGE_SHIFT |
|
||||
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
|
||||
<< wimp_CHILD_TS_EDGE_SHIFT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -587,6 +587,7 @@ bool ro_gui_theme_update_toolbar(struct theme_descriptor *descriptor, struct too
|
||||
os_error *error;
|
||||
osspriteop_area *sprite_area;
|
||||
struct toolbar_icon *toolbar_icon;
|
||||
int width;
|
||||
if (!toolbar) return false;
|
||||
|
||||
/* Set the theme and window sprite area
|
||||
@ -785,9 +786,11 @@ bool ro_gui_theme_update_toolbar(struct theme_descriptor *descriptor, struct too
|
||||
|
||||
/* Force a re-processing of the toolbar
|
||||
*/
|
||||
width = toolbar->toolbar_current;
|
||||
toolbar->reformat_buttons = true;
|
||||
toolbar->toolbar_current = -1;
|
||||
toolbar->status_current = -1;
|
||||
ro_gui_theme_process_toolbar(toolbar, toolbar->toolbar_current);
|
||||
ro_gui_theme_process_toolbar(toolbar, width);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -951,14 +954,13 @@ bool ro_gui_theme_process_toolbar(struct toolbar *toolbar, int width) {
|
||||
|
||||
/* Get the minimum height of the icons
|
||||
*/
|
||||
bottom_edge = left_edge;
|
||||
if (toolbar->display_buttons) {
|
||||
toolbar_icon = toolbar->icon;
|
||||
while (toolbar_icon) {
|
||||
if (toolbar_icon->display) {
|
||||
if (!toolbar->reformat_buttons) {
|
||||
left_edge += toolbar_icon->width;
|
||||
visible_icon = true;
|
||||
}
|
||||
bottom_edge += toolbar_icon->width;
|
||||
visible_icon = true;
|
||||
if ((toolbar_icon->height != 0) &&
|
||||
(toolbar->height < toolbar_icon->height + 8)) {
|
||||
toolbar->height = toolbar_icon->height + 8;
|
||||
@ -966,13 +968,13 @@ bool ro_gui_theme_process_toolbar(struct toolbar *toolbar, int width) {
|
||||
}
|
||||
toolbar_icon = toolbar_icon->next;
|
||||
}
|
||||
if (visible_icon) left_edge += 8;
|
||||
if (visible_icon) bottom_edge += 8;
|
||||
}
|
||||
|
||||
/* Check for minimum widths
|
||||
*/
|
||||
if (toolbar->type == THEME_BROWSER_TOOLBAR) {
|
||||
bottom_edge = left_edge;
|
||||
if (!toolbar->reformat_buttons) left_edge = bottom_edge;
|
||||
if (toolbar->display_url) bottom_edge += 32;
|
||||
if (bottom_edge > right_edge) right_edge = bottom_edge;
|
||||
if ((toolbar->theme) && (toolbar->display_throbber) &&
|
||||
|
@ -295,10 +295,23 @@ void ro_gui_set_window_title(wimp_w w, const char *text) {
|
||||
*/
|
||||
void ro_gui_set_caret_first(wimp_w w) {
|
||||
int icon, button;
|
||||
wimp_window_state win_state;
|
||||
wimp_window_info_base window;
|
||||
wimp_icon_state state;
|
||||
os_error *error;
|
||||
|
||||
/* Check the window is open
|
||||
*/
|
||||
win_state.w = w;
|
||||
error = xwimp_get_window_state(&win_state);
|
||||
if (error) {
|
||||
LOG(("xwimp_get_window_state: 0x%x: %s",
|
||||
error->errnum, error->errmess));
|
||||
warn_user("WimpError", error->errmess);
|
||||
return;
|
||||
}
|
||||
if (!(win_state.flags & wimp_WINDOW_OPEN)) return;
|
||||
|
||||
/* Get the window details
|
||||
*/
|
||||
window.w = w;
|
||||
@ -319,7 +332,7 @@ void ro_gui_set_caret_first(wimp_w w) {
|
||||
state.i = icon;
|
||||
error = xwimp_get_icon_state(&state);
|
||||
if (error) {
|
||||
LOG(("xwimp_get_window_info: 0x%x: %s",
|
||||
LOG(("xwimp_get_icon_state: 0x%x: %s",
|
||||
error->errnum, error->errmess));
|
||||
warn_user("WimpError", error->errmess);
|
||||
return;
|
||||
|
@ -792,6 +792,7 @@ void ro_gui_window_update_theme(void) {
|
||||
ro_gui_theme_destroy_toolbar(hotlist_toolbar);
|
||||
hotlist_toolbar = NULL;
|
||||
}
|
||||
ro_gui_theme_attach_toolbar(hotlist_toolbar, hotlist_window);
|
||||
xwimp_force_redraw(hotlist_window, 0, -16384, 16384, 16384);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user