diff --git a/data/Application.css b/data/Application.css index d3264ea3..25d41996 100644 --- a/data/Application.css +++ b/data/Application.css @@ -96,7 +96,7 @@ .Pebbles_Buttons_Memory { color: #333; - text-shadow: 0 1px alpha (#000, 0.0); + text-shadow: 0 1px alpha (#000, 0.2), 0 0 0 2px #000; -gtk-icon-shadow: 0 1px alpha (#000, 0.0); border-color: alpha(#000, 0.5); background-image: linear-gradient(#ffe16b, #f9c440); @@ -442,4 +442,4 @@ scrolledwindow overshoot.left { border: 1px solid alpha(#000, 0.5); border-radius: 4px; background-color: alpha(@accent_color, 0.2); -} \ No newline at end of file +} diff --git a/data/com.github.subhadeepjasu.pebbles.appdata.xml.in b/data/com.github.subhadeepjasu.pebbles.appdata.xml.in index 4c4a808e..2c7f5f84 100644 --- a/data/com.github.subhadeepjasu.pebbles.appdata.xml.in +++ b/data/com.github.subhadeepjasu.pebbles.appdata.xml.in @@ -93,6 +93,18 @@ none + + +

Fixed:

+
    +
  • [Converter] Fix multiple errors in the converters
  • +
+

Improved:

+
    +
  • [UI] Scale button font with app width (a11y)
  • +
+
+

Improved:

diff --git a/meson.build b/meson.build index 92375721..072c4ff4 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project ( 'com.github.subhadeepjasu.pebbles', 'vala', 'c', - version: '2.0.1', + version: '2.0.2', ) # GNOME module diff --git a/src/Application.vala b/src/Application.vala index 4b034c75..0b8b23a4 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -41,6 +41,8 @@ namespace Pebbles { .pebbles_h1 { font-size: %dpx; } .pebbles_h2 { font-size: %dpx; } .pebbles_h4 { font-size: %dpx; } + .pebbles_button_font_size { font-size: %dpx; } + .pebbles_button_font_size_h3 { font-size: %dpx; } "; public PebblesApp () { @@ -54,9 +56,12 @@ namespace Pebbles { Timeout.add_seconds (1, () => { if (this.get_active_window () != null) { int height = this.get_active_window ().get_allocated_height (); - if (((MainWindow) (this.get_active_window ())).previous_height != height) { + int width = this.get_active_window ().get_allocated_width (); + if (((MainWindow) (this.get_active_window ())).previous_height != height || + ((MainWindow) (this.get_active_window ())).previous_width != width) { ((MainWindow) (this.get_active_window ())).previous_height = height; - adjust_font_responsive (height); + ((MainWindow) (this.get_active_window ())).previous_width = width; + adjust_font_responsive (height, width); } return true; } @@ -131,12 +136,19 @@ namespace Pebbles { private double map_range (double input, double input_start, double input_end, double output_start, double output_end) { return output_start + ((output_end - output_start) / (input_end - input_start)) * (input - input_start); } - private void adjust_font_responsive (int height) { + private void adjust_font_responsive (int height, int width) { try { var target_size_h1 = (int)map_range (double.max((double) height/600, 1), 1, 2, 40, 120); var target_size_h2 = (int)map_range (double.max((double) height/600, 1), 1, 2, 20, 50); var target_size_h4 = (int)map_range (double.max((double) height/600, 1), 1, 2, 10, 20); - var css = DISPLAY_FONT_SIZE_TEMPLATE.printf(target_size_h1, target_size_h2, target_size_h4); + var target_size_button = (int)map_range (double.max((double) width/1000, 1), 1, 1.5, 12, 22); + if (target_size_button < 12) target_size_button = 12; + if (target_size_button > 28) target_size_button = 28; + var css = DISPLAY_FONT_SIZE_TEMPLATE.printf(target_size_h1, + target_size_h2, + target_size_h4, + target_size_button, + target_size_button + 4); font_size_provider.load_from_data (css, -1); } catch (Error e) { Process.exit(1); diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 98c64495..5333200a 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -125,6 +125,7 @@ namespace Pebbles { bool initialized = false; public int previous_height = 0; + public int previous_width = 0; public MainWindow () { settings = Pebbles.Settings.get_default (); @@ -607,6 +608,7 @@ namespace Pebbles { if ((this.common_view.get_visible_child () == this.scientific_view && this.scientific_view.button_leaflet.folded) || (this.common_view.get_visible_child () == this.calculus_view && this.calculus_view.button_leaflet.folded) || (this.common_view.get_visible_child () == this.programmer_view && this.programmer_view.button_leaflet.folded) || + (this.common_view.get_visible_child () == this.statistics_view && this.statistics_view.button_leaflet.folded) || (this.common_view.get_visible_child () == this.date_view && this.date_view.get_allocated_width () < 540) || (this.common_view.get_visible_child () == this.conv_length_view) || (this.common_view.get_visible_child () == this.conv_area_view) || diff --git a/src/Views/CalculusView.vala b/src/Views/CalculusView.vala index fb92c380..8c6efd71 100644 --- a/src/Views/CalculusView.vala +++ b/src/Views/CalculusView.vala @@ -176,9 +176,11 @@ namespace Pebbles { // Make buttons on the left all_clear_button = new StyledButton ("AC", _("All Clear"), {"Delete"}); all_clear_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); + all_clear_button.get_style_context ().add_class ("pebbles_button_font_size"); del_button = new Gtk.Button.from_icon_name ("edit-clear-symbolic", Gtk.IconSize.BUTTON); del_button.set_tooltip_text (_("Backspace")); del_button.get_style_context ().remove_class ("image-button"); + del_button.get_style_context ().add_class ("pebbles_button_font_size"); if (display_unit.input_entry.get_text () =="0" || display_unit.input_entry.get_text () == "") { del_button.sensitive = false; } else { @@ -191,27 +193,41 @@ namespace Pebbles { del_button.sensitive = true; }); variable_button = new StyledButton ("𝑥", _("Variable for linear expressions"), {"X"}); + variable_button.get_style_context ().add_class ("pebbles_button_font_size"); divide_button = new StyledButton ("\xC3\xB7", _("Divide")); - divide_button.get_style_context ().add_class ("h3"); + divide_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); seven_button = new StyledButton ("7"); + seven_button.get_style_context ().add_class ("pebbles_button_font_size"); eight_button = new StyledButton ("8"); + eight_button.get_style_context ().add_class ("pebbles_button_font_size"); nine_button = new StyledButton ("9"); + nine_button.get_style_context ().add_class ("pebbles_button_font_size"); multiply_button = new StyledButton ("\xC3\x97", _("Multiply")); - multiply_button.get_style_context ().add_class ("h3"); + multiply_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); four_button = new StyledButton ("4"); + four_button.get_style_context ().add_class ("pebbles_button_font_size"); five_button = new StyledButton ("5"); + five_button.get_style_context ().add_class ("pebbles_button_font_size"); six_button = new StyledButton ("6"); + six_button.get_style_context ().add_class ("pebbles_button_font_size"); subtract_button = new StyledButton ("\xE2\x88\x92", _("Subtract")); - subtract_button.get_style_context ().add_class ("h3"); + subtract_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); one_button = new StyledButton ("1"); + one_button.get_style_context ().add_class ("pebbles_button_font_size"); two_button = new StyledButton ("2"); + two_button.get_style_context ().add_class ("pebbles_button_font_size"); three_button = new StyledButton ("3"); + three_button.get_style_context ().add_class ("pebbles_button_font_size"); plus_button = new StyledButton ("+", _("Add")); - plus_button.get_style_context ().add_class ("h3"); + plus_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); zero_button = new StyledButton ("0"); + zero_button.get_style_context ().add_class ("pebbles_button_font_size"); decimal_button = new StyledButton (Utils.get_local_radix_symbol ()); + decimal_button.get_style_context ().add_class ("pebbles_button_font_size"); left_parenthesis_button = new StyledButton ("("); + left_parenthesis_button.get_style_context ().add_class ("pebbles_button_font_size"); right_parenthesis_button = new StyledButton (")"); + right_parenthesis_button.get_style_context ().add_class ("pebbles_button_font_size"); button_container_left.attach (all_clear_button, 0, 0, 1, 1); button_container_left.attach (del_button, 1, 0, 1, 1); @@ -240,37 +256,53 @@ namespace Pebbles { // Make buttons on the right pow_root_button = new StyledButton ("xy", _("x raised to the power y"), {"Z"}); pow_root_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + pow_root_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_plus_button = new StyledButton ("M+", _("Add it to the value in Memory"), {"F3"}); memory_plus_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_plus_button.get_style_context ().add_class ("pebbles_button_font_size"); sin_button = new StyledButton ("sin", _("Sine"), {"S"}); sin_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + sin_button.get_style_context ().add_class ("pebbles_button_font_size"); sinh_button = new StyledButton ("sinh", _("Hyperbolic Sine"), {"H"}); sinh_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + sinh_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_minus_button = new StyledButton ("M\xE2\x88\x92", _("Subtract it from the value in Memory"), {"F4"}); memory_minus_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_minus_button.get_style_context ().add_class ("pebbles_button_font_size"); cos_button = new StyledButton ("cos", _("Cosine"), {"C"}); cos_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + cos_button.get_style_context ().add_class ("pebbles_button_font_size"); cosh_button = new StyledButton ("cosh", _("Hyperbolic Cosine"), {"O"}); cosh_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + cosh_button.get_style_context ().add_class ("pebbles_button_font_size"); log_mod_button = new StyledButton ("Mod", _("Modulus"), {"M"}); log_mod_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + log_mod_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_recall_button = new StyledButton ("MR", _("Recall value from Memory"), {"F5"}); memory_recall_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_recall_button.get_style_context ().add_class ("pebbles_button_font_size"); tan_button = new StyledButton ("tan", _("Tangent"), {"T"}); tan_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + tan_button.get_style_context ().add_class ("pebbles_button_font_size"); tanh_button = new StyledButton ("tanh", _("Hyperbolic Tangent"), {"A"}); tanh_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + tanh_button.get_style_context ().add_class ("pebbles_button_font_size"); perm_comb_button = new StyledButton ("nP\xE1\xB5\xA3", _("Permutations"), {"P"}); perm_comb_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + perm_comb_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_clear_button = new StyledButton ("MC", _("Memory Clear"), {"F6"}); memory_clear_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_clear_button.get_style_context ().add_class ("pebbles_button_font_size"); fact_button = new StyledButton ("!", _("Factorial"), {"F"}); fact_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + fact_button.get_style_context ().add_class ("pebbles_button_font_size"); constant_button = new StyledButton (constant_label_1, constant_desc_1, {"R"}); constant_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + constant_button.get_style_context ().add_class ("pebbles_button_font_size"); last_answer_button = new StyledButton ("Ans", _("Last answer"), {"F7"}); last_answer_button.sensitive = false; last_answer_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + last_answer_button.get_style_context ().add_class ("pebbles_button_font_size"); // Make integration section var integration_grid = new Gtk.Grid (); @@ -280,6 +312,7 @@ namespace Pebbles { integration_button = new StyledButton ("\xE2\x88\xAB", _("Definite Integral (Upper limit 'u' and Lower limit 'l')"), {"I"}); integration_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); integration_button.get_style_context ().add_class ("suggested-override"); + integration_button.get_style_context ().add_class ("pebbles_button_font_size"); integration_button.margin_top = 5; integration_button.margin_start = 2; @@ -341,6 +374,7 @@ namespace Pebbles { derivation_button = new StyledButton ("dy/dx", _("Derivative (at a point x)"), {"D"}); derivation_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); derivation_button.get_style_context ().add_class ("suggested-override"); + derivation_button.get_style_context ().add_class ("pebbles_button_font_size"); derivation_button.margin_top = 5; derivation_button.margin_start = 2; diff --git a/src/Views/CommonKeyPadConverter.vala b/src/Views/CommonKeyPadConverter.vala index f8eebb29..68869744 100644 --- a/src/Views/CommonKeyPadConverter.vala +++ b/src/Views/CommonKeyPadConverter.vala @@ -47,19 +47,32 @@ namespace Pebbles { del_button = new Gtk.Button.from_icon_name ("edit-clear-symbolic", Gtk.IconSize.BUTTON); del_button.set_tooltip_text (_("Backspace")); del_button.get_style_context ().remove_class ("image-button"); + del_button.get_style_context ().add_class ("pebbles_button_font_size"); all_clear_button = new StyledButton ("AC", (_("Clear Entry"))); all_clear_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); + all_clear_button.get_style_context ().add_class ("pebbles_button_font_size"); seven_button = new StyledButton ("7"); + seven_button.get_style_context ().add_class ("pebbles_button_font_size"); eight_button = new StyledButton ("8"); + eight_button.get_style_context ().add_class ("pebbles_button_font_size"); nine_button = new StyledButton ("9"); + nine_button.get_style_context ().add_class ("pebbles_button_font_size"); four_button = new StyledButton ("4"); + four_button.get_style_context ().add_class ("pebbles_button_font_size"); five_button = new StyledButton ("5"); + five_button.get_style_context ().add_class ("pebbles_button_font_size"); six_button = new StyledButton ("6"); + six_button.get_style_context ().add_class ("pebbles_button_font_size"); one_button = new StyledButton ("1"); + one_button.get_style_context ().add_class ("pebbles_button_font_size"); two_button = new StyledButton ("2"); + two_button.get_style_context ().add_class ("pebbles_button_font_size"); three_button = new StyledButton ("3"); + three_button.get_style_context ().add_class ("pebbles_button_font_size"); zero_button = new StyledButton ("0"); + zero_button.get_style_context ().add_class ("pebbles_button_font_size"); decimal_button = new StyledButton ("."); + decimal_button.get_style_context ().add_class ("pebbles_button_font_size"); // Arange the buttons attach (all_clear_button, 0, 0, 1, 1); diff --git a/src/Views/CommonNumericKeypad.vala b/src/Views/CommonNumericKeypad.vala index 03eba8d7..d5cb57db 100644 --- a/src/Views/CommonNumericKeypad.vala +++ b/src/Views/CommonNumericKeypad.vala @@ -49,6 +49,7 @@ namespace Pebbles { construct { main_grid = new Gtk.Grid (); + this.get_style_context ().add_class ("pebbles_button_font_size"); // Make the buttons del_button = new StyledButton ("Del", (_("Backspace"))); all_clear_button = new StyledButton ("AC", (_("All Clear"))); diff --git a/src/Views/ProgrammerView.vala b/src/Views/ProgrammerView.vala index a9b45970..853e7fd6 100644 --- a/src/Views/ProgrammerView.vala +++ b/src/Views/ProgrammerView.vala @@ -136,9 +136,11 @@ namespace Pebbles { // Make buttons on the left all_clear_button = new StyledButton ("AC", "All Clear", {"Delete"}); all_clear_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); + all_clear_button.get_style_context ().add_class ("pebbles_button_font_size"); del_button = new Gtk.Button.from_icon_name ("edit-clear-symbolic", Gtk.IconSize.BUTTON); del_button.set_tooltip_text (_("Backspace")); del_button.get_style_context ().remove_class ("image-button"); + del_button.get_style_context ().add_class ("pebbles_button_font_size"); if (display_unit.input_entry.get_text () =="0" || display_unit.input_entry.get_text () == "") { del_button.sensitive = false; } else { @@ -151,43 +153,63 @@ namespace Pebbles { del_button.sensitive = true; }); seven_button = new StyledButton ("7"); + seven_button.get_style_context ().add_class ("pebbles_button_font_size"); eight_button = new StyledButton ("8"); + eight_button.get_style_context ().add_class ("pebbles_button_font_size"); nine_button = new StyledButton ("9"); + nine_button.get_style_context ().add_class ("pebbles_button_font_size"); a_button = new StyledButton ("A"); a_button.set_sensitive (false); + a_button.get_style_context ().add_class ("pebbles_button_font_size"); d_button = new StyledButton ("D"); d_button.set_sensitive (false); + d_button.get_style_context ().add_class ("pebbles_button_font_size"); div_button = new StyledButton ("\xC3\xB7"); - div_button.get_style_context ().add_class ("h3"); + div_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); four_button = new StyledButton ("4"); + four_button.get_style_context ().add_class ("pebbles_button_font_size"); five_button = new StyledButton ("5"); + five_button.get_style_context ().add_class ("pebbles_button_font_size"); six_button = new StyledButton ("6"); + six_button.get_style_context ().add_class ("pebbles_button_font_size"); b_button = new StyledButton ("B"); + b_button.get_style_context ().add_class ("pebbles_button_font_size"); b_button.set_sensitive (false); e_button = new StyledButton ("E"); + e_button.get_style_context ().add_class ("pebbles_button_font_size"); e_button.set_sensitive (false); multi_button = new StyledButton ("\xC3\x97"); - multi_button.get_style_context ().add_class ("h3"); + multi_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); one_button = new StyledButton ("1"); + one_button.get_style_context ().add_class ("pebbles_button_font_size"); two_button = new StyledButton ("2"); + two_button.get_style_context ().add_class ("pebbles_button_font_size"); three_button = new StyledButton ("3"); + three_button.get_style_context ().add_class ("pebbles_button_font_size"); c_button = new StyledButton ("C"); + c_button.get_style_context ().add_class ("pebbles_button_font_size"); c_button.set_sensitive (false); f_button = new StyledButton ("F"); + f_button.get_style_context ().add_class ("pebbles_button_font_size"); f_button.set_sensitive (false); minus_button = new StyledButton ("\xE2\x88\x92"); - minus_button.get_style_context ().add_class ("h3"); + minus_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); zero_button = new StyledButton ("0"); + zero_button.get_style_context ().add_class ("pebbles_button_font_size"); left_parenthesis_button = new StyledButton ("("); + left_parenthesis_button.get_style_context ().add_class ("pebbles_button_font_size"); right_parenthesis_button = new StyledButton (")"); + right_parenthesis_button.get_style_context ().add_class ("pebbles_button_font_size"); bit_button = new Gtk.Button.from_icon_name ("view-grid-symbolic", Gtk.IconSize.BUTTON); bit_button.tooltip_text = _("Bit toggle grid"); bit_button.get_style_context ().remove_class ("image-button"); lsh_rsh_button = new StyledButton ("Lsh", _("Left Shift")); + lsh_rsh_button.get_style_context ().add_class ("pebbles_button_font_size"); plus_button = new StyledButton ("+"); - plus_button.get_style_context ().add_class ("h3"); + plus_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); bit_mode_button = new Granite.Widgets.ModeButton (); + bit_mode_button.get_style_context ().add_class ("pebbles_button_font_size"); bit_mode_button.append_text (" HEXA "); bit_mode_button.append_text ("DECI"); bit_mode_button.append_text ("OCTL"); @@ -214,27 +236,37 @@ namespace Pebbles { // Make buttons on the right or_button = new StyledButton ("Or", _("Logical OR (TRUE for any input being TRUE)"), {"O"}); or_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + or_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_plus_button = new StyledButton (" M+ ", _("Add it to the value in Memory"), {"F3"}); memory_plus_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_plus_button.get_style_context ().add_class ("pebbles_button_font_size"); and_button = new StyledButton (" And ", _("Logical AND (TRUE for all inputs being TRUE)"), {"N"}); and_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + and_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_minus_button = new StyledButton ("M-", _("Subtract it from the value in Memory"), {"F4"}); memory_minus_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_minus_button.get_style_context ().add_class ("pebbles_button_font_size"); xor_button = new StyledButton ("Xor", _("Logical Exclusive-OR (TRUE for exactly one input being TRUE)"), {"X"}); xor_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + xor_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_recall_button = new StyledButton ("MR", _("Recall value from Memory"), {"F5"}); memory_recall_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_recall_button.get_style_context ().add_class ("pebbles_button_font_size"); not_button = new StyledButton ("Not", _("Logical Inverter (TRUE for input being FALSE and vice versa)"), {"T"}); not_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + not_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_clear_button = new StyledButton ("MC", _("Memory Clear"), {"F6"}); memory_clear_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_clear_button.get_style_context ().add_class ("pebbles_button_font_size"); ans_button = new StyledButton ("Ans", _("Last answer"), {"F7"}); ans_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); ans_button.set_sensitive (false); + ans_button.get_style_context ().add_class ("pebbles_button_font_size"); result_button = new StyledButton ("=", _("Result"), {"Return"}); - result_button.get_style_context ().add_class ("h2"); result_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); + result_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); shift_button = new StyledButton (_("Shift"), _("Access alternative functions")); + shift_button.get_style_context ().add_class ("pebbles_button_font_size"); button_container_left.attach (all_clear_button, 0, 0, 1, 1); button_container_left.attach (del_button, 1, 0, 1, 1); diff --git a/src/Views/ScientificView.vala b/src/Views/ScientificView.vala index 37d34870..672a3e8c 100644 --- a/src/Views/ScientificView.vala +++ b/src/Views/ScientificView.vala @@ -170,9 +170,11 @@ namespace Pebbles { // Make buttons on the left all_clear_button = new StyledButton ("AC", _("All Clear"), {"Delete"}); all_clear_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); + all_clear_button.get_style_context ().add_class ("pebbles_button_font_size"); del_button = new Gtk.Button.from_icon_name ("edit-clear-symbolic", Gtk.IconSize.BUTTON); del_button.set_tooltip_text (_("Backspace")); del_button.get_style_context ().remove_class ("image-button"); + del_button.get_style_context ().add_class ("pebbles_button_font_size"); if (display_unit.input_entry.get_text () =="0" || display_unit.input_entry.get_text () == "") { del_button.sensitive = false; } else { @@ -185,28 +187,41 @@ namespace Pebbles { del_button.sensitive = true; }); percent_button = new StyledButton ("%", _("Percentage")); - percent_button.get_style_context ().add_class ("h3"); + percent_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); divide_button = new StyledButton ("\xC3\xB7", _("Divide")); - divide_button.get_style_context ().add_class ("h3"); + divide_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); seven_button = new StyledButton ("7"); + seven_button.get_style_context ().add_class ("pebbles_button_font_size"); eight_button = new StyledButton ("8"); + eight_button.get_style_context ().add_class ("pebbles_button_font_size"); nine_button = new StyledButton ("9"); + nine_button.get_style_context ().add_class ("pebbles_button_font_size"); multiply_button = new StyledButton ("\xC3\x97", _("Multiply")); - multiply_button.get_style_context ().add_class ("h3"); + multiply_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); four_button = new StyledButton ("4"); + four_button.get_style_context ().add_class ("pebbles_button_font_size"); five_button = new StyledButton ("5"); + five_button.get_style_context ().add_class ("pebbles_button_font_size"); six_button = new StyledButton ("6"); + six_button.get_style_context ().add_class ("pebbles_button_font_size"); subtract_button = new StyledButton ("\xE2\x88\x92", _("Subtract")); - subtract_button.get_style_context ().add_class ("h3"); + subtract_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); one_button = new StyledButton ("1"); + one_button.get_style_context ().add_class ("pebbles_button_font_size"); two_button = new StyledButton ("2"); + two_button.get_style_context ().add_class ("pebbles_button_font_size"); three_button = new StyledButton ("3"); + three_button.get_style_context ().add_class ("pebbles_button_font_size"); plus_button = new StyledButton ("+", _("Add")); - plus_button.get_style_context ().add_class ("h3"); + plus_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); zero_button = new StyledButton ("0"); + zero_button.get_style_context ().add_class ("pebbles_button_font_size"); decimal_button = new StyledButton (Utils.get_local_radix_symbol ()); + decimal_button.get_style_context ().add_class ("pebbles_button_font_size"); left_parenthesis_button = new StyledButton ("("); + left_parenthesis_button.get_style_context ().add_class ("pebbles_button_font_size"); right_parenthesis_button = new StyledButton (")"); + right_parenthesis_button.get_style_context ().add_class ("pebbles_button_font_size"); button_container_left.attach (all_clear_button, 0, 0, 1, 1); button_container_left.attach (del_button, 1, 0, 1, 1); @@ -235,47 +250,67 @@ namespace Pebbles { // Make buttons on the right sqr_button = new StyledButton ("x2", _("Square a number"), {"Q"}); sqr_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + sqr_button.get_style_context ().add_class ("pebbles_button_font_size"); pow_root_button = new StyledButton ("xy", _("x raised to the power y"), {"Z"}); pow_root_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + pow_root_button.get_style_context ().add_class ("pebbles_button_font_size"); expo_power_button = new StyledButton ("10x", _("10 raised to the power x"), {"W"}); expo_power_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + expo_power_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_plus_button = new StyledButton ("M+", _("Add it to the value in Memory"), {"F3"}); memory_plus_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_plus_button.get_style_context ().add_class ("pebbles_button_font_size"); sin_button = new StyledButton ("sin", _("Sine"), {"S"}); sin_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + sin_button.get_style_context ().add_class ("pebbles_button_font_size"); sinh_button = new StyledButton ("sinh", _("Hyperbolic Sine"), {"H"}); sinh_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + sinh_button.get_style_context ().add_class ("pebbles_button_font_size"); log_cont_base_button = new StyledButton ("log x", _("Log base 10"), {"L"}); log_cont_base_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + log_cont_base_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_minus_button = new StyledButton ("M\xE2\x88\x92", _("Subtract it from the value in Memory"), {"F4"}); memory_minus_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_minus_button.get_style_context ().add_class ("pebbles_button_font_size"); cos_button = new StyledButton ("cos", _("Cosine"), {"C"}); cos_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + cos_button.get_style_context ().add_class ("pebbles_button_font_size"); cosh_button = new StyledButton ("cosh", _("Hyperbolic Cosine"), {"O"}); cosh_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + cosh_button.get_style_context ().add_class ("pebbles_button_font_size"); log_mod_button = new StyledButton ("Mod", _("Modulus"), {"M"}); log_mod_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + log_mod_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_recall_button = new StyledButton ("MR", _("Recall value from Memory"), {"F5"}); memory_recall_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_recall_button.get_style_context ().add_class ("pebbles_button_font_size"); tan_button = new StyledButton ("tan", _("Tangent"), {"T"}); tan_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + tan_button.get_style_context ().add_class ("pebbles_button_font_size"); tanh_button = new StyledButton ("tanh", _("Hyperbolic Tangent"), {"A"}); tanh_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + tanh_button.get_style_context ().add_class ("pebbles_button_font_size"); perm_comb_button = new StyledButton ("nP\xE1\xB5\xA3", _("Permutations"), {"P"}); perm_comb_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + perm_comb_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_clear_button = new StyledButton ("MC", _("Memory Clear"), {"F6"}); memory_clear_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_clear_button.get_style_context ().add_class ("pebbles_button_font_size"); fact_button = new StyledButton ("!", _("Factorial"), {"F"}); fact_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + fact_button.get_style_context ().add_class ("pebbles_button_font_size"); constant_button = new StyledButton (constant_label_1, constant_desc_1, {"R"}); constant_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + constant_button.get_style_context ().add_class ("pebbles_button_font_size"); last_answer_button = new StyledButton ("Ans", _("Last answer"), {"F7"}); last_answer_button.sensitive = false; last_answer_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + last_answer_button.get_style_context ().add_class ("pebbles_button_font_size"); result_button = new StyledButton ("=", _("Result"), {"Return"}); - result_button.get_style_context ().add_class ("h2"); result_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); + result_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); shift_button = new StyledButton (_("Shift"), _("Access alternative functions")); + shift_button.get_style_context ().add_class ("pebbles_button_font_size"); button_container_right.attach (sqr_button, 0, 0, 1, 1); button_container_right.attach (pow_root_button, 1, 0, 1, 1); diff --git a/src/Views/StatisticsView.vala b/src/Views/StatisticsView.vala index 789dff65..402f486d 100644 --- a/src/Views/StatisticsView.vala +++ b/src/Views/StatisticsView.vala @@ -135,23 +135,38 @@ namespace Pebbles { // Make buttons on the left all_clear_button = new StyledButton ("AC", (_("All Clear")), {"Delete"}); all_clear_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); + all_clear_button.get_style_context ().add_class ("pebbles_button_font_size"); del_button = new Gtk.Button.from_icon_name ("edit-clear-symbolic", Gtk.IconSize.BUTTON); del_button.set_tooltip_text (_("Backspace")); del_button.sensitive = false; del_button.get_style_context ().remove_class ("image-button"); + del_button.get_style_context ().add_class ("pebbles_button_font_size"); reset_button = new StyledButton (_("Reset"), _("Clear sample"), {"End"}); + reset_button.get_style_context ().add_class ("pebbles_button_font_size"); seven_button = new StyledButton ("7"); + seven_button.get_style_context ().add_class ("pebbles_button_font_size"); eight_button = new StyledButton ("8"); + eight_button.get_style_context ().add_class ("pebbles_button_font_size"); nine_button = new StyledButton ("9"); + nine_button.get_style_context ().add_class ("pebbles_button_font_size"); four_button = new StyledButton ("4"); + four_button.get_style_context ().add_class ("pebbles_button_font_size"); five_button = new StyledButton ("5"); + five_button.get_style_context ().add_class ("pebbles_button_font_size"); six_button = new StyledButton ("6"); + six_button.get_style_context ().add_class ("pebbles_button_font_size"); one_button = new StyledButton ("1"); + one_button.get_style_context ().add_class ("pebbles_button_font_size"); two_button = new StyledButton ("2"); + two_button.get_style_context ().add_class ("pebbles_button_font_size"); three_button = new StyledButton ("3"); + three_button.get_style_context ().add_class ("pebbles_button_font_size"); zero_button = new StyledButton ("0"); + zero_button.get_style_context ().add_class ("pebbles_button_font_size"); decimal_button = new StyledButton ("."); + decimal_button.get_style_context ().add_class ("pebbles_button_font_size"); negative_button = new StyledButton ("+/-", _("Negative")); + negative_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); button_container_left.attach (all_clear_button, 0, 0, 1, 1); button_container_left.attach (del_button, 1, 0, 1, 1); @@ -175,44 +190,62 @@ namespace Pebbles { // Make buttons on the right nav_left_button = new StyledButton ("❰", _("Navigate to the cell on the left"), {"Left"}); + nav_left_button.get_style_context ().add_class ("pebbles_button_font_size"); nav_right_button = new StyledButton ("❱", _("Navigate to the cell on the right"), {"Right"}); + nav_right_button.get_style_context ().add_class ("pebbles_button_font_size"); add_cell_button = new StyledButton ("▭⁺", _("Left click: Add cell, Right click: Insert cell"), {"Page_Up", "Page_Down"}); - add_cell_button.get_style_context ().add_class ("h3"); + add_cell_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); add_cell_button.get_style_context ().add_class ("pebbles_button_prompt"); remove_cell_button = new StyledButton ("▭⁻", _("Remove current cell"), {"Home"}); - remove_cell_button.get_style_context ().add_class ("h3"); + remove_cell_button.get_style_context ().add_class ("pebbles_button_font_size_h3"); cardinality_button = new StyledButton ("n", _("Sample size"), {"N"}); cardinality_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + cardinality_button.get_style_context ().add_class ("pebbles_button_font_size"); statistical_mode_button = new StyledButton ("mode", _("Mode of the sample data"), {"O"}); statistical_mode_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + statistical_mode_button.get_style_context ().add_class ("pebbles_button_font_size"); median_button = new StyledButton ("M", _("Median"), {"E"}); median_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + median_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_plus_button = new StyledButton ("M+", _("Add to Memory"), {"F2"}); memory_plus_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_plus_button.get_style_context ().add_class ("pebbles_button_font_size"); summation_button = new StyledButton ("Σx", _("Summation of all data values"), {"S"}); summation_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + summation_button.get_style_context ().add_class ("pebbles_button_font_size"); summation_sq_button = new StyledButton ("Σx2", _("Summation of all data values squared"), {"Q"}); summation_sq_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + summation_sq_button.get_style_context ().add_class ("pebbles_button_font_size"); sample_variance_button = new StyledButton ("SV", _("Sample variance"), {"V"}); sample_variance_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + sample_variance_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_minus_button = new StyledButton ("M-", _("Subtract from Memory"), {"F3"}); memory_minus_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_minus_button.get_style_context ().add_class ("pebbles_button_font_size"); mean_button = new StyledButton ("x̄", _("Mean"), {"M"}); mean_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + mean_button.get_style_context ().add_class ("pebbles_button_font_size"); mean_sq_button = new StyledButton ("x̄2", _("Mean of squared data values"), {"A"}); mean_sq_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + mean_sq_button.get_style_context ().add_class ("pebbles_button_font_size"); sample_std_dev_button = new StyledButton ("SD", _("Standard deviation"), {"D"}); sample_std_dev_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + sample_std_dev_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_recall_button = new StyledButton ("MR", _("Memory Recall"), {"F4"}); memory_recall_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_recall_button.get_style_context ().add_class ("pebbles_button_font_size"); geometric_mean_button = new StyledButton ("GM", _("Geometric mean"), {"G"}); geometric_mean_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + geometric_mean_button.get_style_context ().add_class ("pebbles_button_font_size"); pop_variance_button = new StyledButton ("σ2", _("Population Variance"), {"P"}); pop_variance_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + pop_variance_button.get_style_context ().add_class ("pebbles_button_font_size"); pop_std_dev_button = new StyledButton ("σ", _("Population standard deviation"), {"L"}); pop_std_dev_button.get_style_context ().add_class ("Pebbles_Buttons_Function"); + pop_std_dev_button.get_style_context ().add_class ("pebbles_button_font_size"); memory_clear_button = new StyledButton ("MC", _("Memory Clear"), {"F5"}); memory_clear_button.get_style_context ().add_class ("Pebbles_Buttons_Memory"); + memory_clear_button.get_style_context ().add_class ("pebbles_button_font_size");