From 3cb61cacf38f288085b6924d83bd05e4fb89b723 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Wed, 12 Nov 2014 19:26:44 +0200 Subject: [PATCH] [Summary] Changed Yes-No and Ok dialogs on Igor's request. Code improvement. --- gtk2_ardour/ok_dialog.cc | 7 +++++-- gtk2_ardour/ui/ok_dialog.xml | 9 +++++---- gtk2_ardour/ui/yes_no_dialog.xml | 17 +++++++++-------- gtk2_ardour/yes_no_dialog.cc | 7 +++++-- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/gtk2_ardour/ok_dialog.cc b/gtk2_ardour/ok_dialog.cc index 32797f027d..ea44c1f367 100644 --- a/gtk2_ardour/ok_dialog.cc +++ b/gtk2_ardour/ok_dialog.cc @@ -30,7 +30,7 @@ using namespace Pango; namespace { const size_t button_left_padding = 10; - const size_t button_bottom_padding = 10; + const size_t button_bottom_padding = 15; const size_t font_size = 12; const size_t label_top_padding = 10; @@ -60,7 +60,7 @@ namespace { if ( current_lines_number > max_lines_number ) { - return current_window_height + (current_lines_number - max_lines_number) * font_size; + return current_window_height + (current_lines_number - max_lines_number + 1) * font_size; } else return current_window_height; } @@ -78,6 +78,7 @@ OkDialog::OkDialog (std::string window_title, std::string info_lines) { set_modal (true); set_resizable (false); + this->set_keep_above (true); _info_label.set_text( info_lines ); this->set_title(window_title); @@ -106,6 +107,8 @@ OkDialog::OkDialog (std::string window_title, std::string info_lines) button_width = _ok_button.get_allocation().get_width(); button_height = _ok_button.get_allocation().get_height(); + _info_label.set_size_request( layout_width, new_window_height - button_height - button_bottom_padding); + _layout.put( _ok_button, layout_width - button_width - button_left_padding, new_window_height - button_height - button_bottom_padding); } diff --git a/gtk2_ardour/ui/ok_dialog.xml b/gtk2_ardour/ui/ok_dialog.xml index afb16de23f..e5c0c758af 100644 --- a/gtk2_ardour/ui/ok_dialog.xml +++ b/gtk2_ardour/ui/ok_dialog.xml @@ -17,17 +17,18 @@ height="120" bgnormal="#EDECE8">