ship_selection_button::ship_selection_button(ui_container* parent) : ui_button(parent) {
    set_width(16.f);
    set_height(16.f);
    set_halign(horizontal_alignment::left);
    set_valign(vertical_alignment::top);
    set_margin(10.f);
    selection_state = ship_selection_button_state::unknown;
}
Exemplo n.º 2
0
inline const layout_attributes_t& group_layout_attributes()
{
    static layout_attributes_t result;
    static bool                       inited(false);

    if (!inited)
    {
        inited = true;

        result.placement_m = eve_t::place_column;
        set_margin(result, 10); /* REVISIT FIXED VALUE */
    }

    return result;
}
Exemplo n.º 3
0
void ColorPicker::_notification(int p_what) {

	switch (p_what) {
		case NOTIFICATION_THEME_CHANGED: {

			btn_pick->set_icon(get_icon("screen_picker", "ColorPicker"));
			bt_add_preset->set_icon(get_icon("add_preset"));

			_update_controls();
		} break;
		case NOTIFICATION_ENTER_TREE: {

			btn_pick->set_icon(get_icon("screen_picker", "ColorPicker"));
			bt_add_preset->set_icon(get_icon("add_preset"));

			_update_color();

#ifdef TOOLS_ENABLED
			if (Engine::get_singleton()->is_editor_hint()) {
				PoolColorArray saved_presets = EditorSettings::get_singleton()->get_project_metadata("color_picker", "presets", PoolColorArray());

				for (int i = 0; i < saved_presets.size(); i++) {
					add_preset(saved_presets[i]);
				}
			}
#endif
		} break;
		case NOTIFICATION_PARENTED: {

			for (int i = 0; i < 4; i++)
				set_margin((Margin)i, get_constant("margin"));
		} break;
		case NOTIFICATION_VISIBILITY_CHANGED: {

			Popup *p = Object::cast_to<Popup>(get_parent());
			if (p)
				p->set_size(Size2(get_combined_minimum_size().width + get_constant("margin") * 2, get_combined_minimum_size().height + get_constant("margin") * 2));
		} break;
		case MainLoop::NOTIFICATION_WM_QUIT_REQUEST: {

			if (screen != NULL) {
				if (screen->is_visible()) {
					screen->hide();
				}
			}
		} break;
	}
}
Exemplo n.º 4
0
inline const layout_attributes_t& window_layout_attributes()
{
    static layout_attributes_t result;
    static bool                       inited(false);

    if (!inited)
    {
        inited = true;

        result.placement_m = eve_t::place_row;
        set_margin(result, 10); /* REVISIT FIXED VALUE dialog_margin */
        result.spacing_m[1] = 20; /* REVISIT FIXED VALUE */
    }

    return result;
}
Exemplo n.º 5
0
static void redraw_remark_lines(void)
{
    int i=0,tls = line_space, j;
    Char *temptxt = text;

    if (!remark_is_open || !text) return;
    line_space = 3;
    set_output_window(&remark_win);
    set_margin(draw_pos);
    set_x_y(0,MARGIN);

    if (scrollbar)
	j = scrollbar_line(scrollbar,0);
    else
	j=0;
    while (i<j) {
	while (*temptxt && !IsNewline(*temptxt)) temptxt++;
	i++;
	if (!*temptxt)
	    i=j;
	else
	    temptxt++;
    }
    if (i==selected_line) set_text_mode(Reverse);
    while (*temptxt && i<j+nr_visible) {
	if (IsNewline(*temptxt)) {
	    if (where_x() && where_x()<black_width)
		thinspace(black_width-where_x());
	    if (i==selected_line) set_text_mode(Normal);
	    out_char(*temptxt);
	    i++;
	    if (i==selected_line) set_text_mode(Reverse);
	} else
	    out_char(*temptxt);
	temptxt++;
    }
    if (where_x() && where_x()<black_width) thinspace(black_width-where_x());
    out_char(Newline);
    clear_to_end_of_page();
    unset_output_window();
    line_space = tls;
}
Exemplo n.º 6
0
void BoxStyle::set_margin(float size)
{
    set_margin(size, size, size, size);
}
Exemplo n.º 7
0
void BoxStyle::set_margin(float width, float height)
{
    set_margin(width, height, width, height);
}