editor toolbar tweaks

This commit is contained in:
Tomasz Śniatowski 2009-02-08 12:04:46 +01:00
parent 0f7d990634
commit 9dd79a1490
3 changed files with 24 additions and 18 deletions

View file

@ -103,7 +103,7 @@
[panel]
id=middle-right-panel
image=themes/rightside-bg.png
rect="=,+0,=,+421"
rect="=,+0,=,768"
xanchor=right
yanchor=top
[/panel]
@ -215,7 +215,7 @@
items=undo
auto_tooltip=yes
ref=draw_button_editor
rect="=,+104,+24,+24"
rect="=,+40,+24,+24"
xanchor=right
yanchor=fixed
[/menu]
@ -267,16 +267,16 @@
[/label]
[status]
[editor2_tool_hint]
id=tool-hint
font_size={DEFAULT_EDITOR_FONT_REALLYTINY}
ref=draw_button_editor
rect="=,+6,+110,+40"
xanchor=right
yanchor=fixed
prefix="" #wmllint: ignore
prefix_literal=""
[/editor2_tool_hint]
#[editor2_tool_hint]
# id=tool-hint
# font_size={DEFAULT_EDITOR_FONT_REALLYTINY}
# ref=draw_button_editor
# rect="=,+6,+110,+40"
# xanchor=right
# yanchor=fixed
# prefix="" #wmllint: ignore
# prefix_literal=""
#[/editor2_tool_hint]
# the time of day image
# [time_of_day]

View file

@ -176,7 +176,8 @@ void editor_controller::init_mouse_actions(const config& game_config)
new mouse_action_paste(clipboard_, key_)));
foreach (const theme::menu& menu, gui().get_theme().menus()) {
if (menu.items().size() == 1) {
mouse_action_map::iterator i = mouse_actions_.find(hotkey::get_hotkey(menu.items().front()).get_id());
hotkey::HOTKEY_COMMAND hk = hotkey::get_hotkey(menu.items().front()).get_id();
mouse_action_map::iterator i = mouse_actions_.find(hk);
if (i != mouse_actions_.end()) {
i->second->set_toolbar_button(&menu);
}
@ -185,6 +186,13 @@ void editor_controller::init_mouse_actions(const config& game_config)
foreach (const config* c, game_config.get_children("editor_tool_hint")) {
mouse_action_map::iterator i = mouse_actions_.find(hotkey::get_hotkey((*c)["id"]).get_id());
if (i != mouse_actions_.end()) {
if ((*c)["id"] != "editor-paste") {
std::stringstream dss;
dss << hotkey::get_hotkey((*c)["id"]).get_description();
dss << "\n";
dss << (*c)["text"];
hotkey::get_hotkey((*c)["id"]).set_description(dss.str());
}
mouse_action_hints_.insert(std::make_pair(i->first, (*c)["text"]));
}
}

View file

@ -47,14 +47,12 @@ size_specs::size_specs()
void adjust_sizes(const display &disp, size_specs &sizes) {
/** @todo Hardcoded coordinates for brush selection, make it themeable. */
sizes.brush_x = disp.map_outside_area().w + 10;
sizes.brush_y = 270;
sizes.brush_y = 209;
/** @todo Hardcoded coordinates for terrain palette, make it themeable. */
sizes.palette_x = disp.map_outside_area().w + 16;
sizes.palette_y = sizes.brush_y + 92;
sizes.palette_y = sizes.brush_y + 72;
sizes.palette_w = sizes.terrain_space * default_palette_width;
//the '-5' make sure that the scroll down button can not be outside of
//the window, this is probably a bug in placement anyway...
sizes.palette_h = disp.h() - sizes.palette_y - 5;
sizes.palette_h = disp.h() - sizes.palette_y;
}
} // end namespace editor2