From fae3e4b410d9430dc953997e61afb8516ba86281 Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Fri, 26 Feb 2016 21:06:00 -0500
Subject: [PATCH] first draft to make dialog styles look a bit better

---
 pd/nw/css/default.css             |  32 ++++++---
 pd/nw/dialog_canvas.html          | 109 ++++++++++++++++--------------
 pd/nw/dialog_font.html            |   2 +-
 pd/nw/dialog_gatom.html           |   2 +-
 pd/nw/dialog_iemgui.html          |   2 +-
 pd/nw/dialog_prefs.html           |   2 +-
 pd/nw/locales/en/translation.json |   2 +-
 pd/nw/pdgui.js                    |   6 +-
 8 files changed, 92 insertions(+), 65 deletions(-)

diff --git a/pd/nw/css/default.css b/pd/nw/css/default.css
index 4645e3635..a397ede93 100644
--- a/pd/nw/css/default.css
+++ b/pd/nw/css/default.css
@@ -336,6 +336,10 @@ text {
 
 /* Common to all dialogs */
 
+.dialog_body {
+    background-color:#ccc;
+}
+
 .submit_buttons {
     text-align: center;
     padding: 8px;
@@ -343,12 +347,16 @@ text {
 
 fieldset {
     font-family:Georgia;
-    background-color:#eeeeee;
+    background-color:#ccc;
     border-radius:3px;
-    border:2px solid black;
+    border:1px solid #ddd;
     margin-left:auto;
     margin-right:auto;
-    padding: 10px;
+    padding: 8px;
+}
+
+legend {
+    font-size: 1.2em;
 }
 
 .hidden {
@@ -361,11 +369,6 @@ fieldset {
 
 /* Iemgui dialog */
 
-#iemgui_dialog_body {
-    font-family:Verdana;
-    margin: 0px;
-}
-
 input[type="text"]{
     width:3em;
 }
@@ -435,6 +438,7 @@ div.y1 {
 div.x1 {
     text-align: center;
     padding: 3px;
+    white-space: nowrap;
 }
 
 div.y2 {
@@ -442,6 +446,18 @@ div.y2 {
     padding: 3px;
 }
 
+.x-margin {
+    white-space: nowrap;
+}
+
+.array_style {
+    white-space: nowrap;
+}
+
+#array_name_input {
+    width: 6em;
+}
+
 .disabled {
     color: #aaa;
 }
diff --git a/pd/nw/dialog_canvas.html b/pd/nw/dialog_canvas.html
index c5b37552e..11f9c9842 100644
--- a/pd/nw/dialog_canvas.html
+++ b/pd/nw/dialog_canvas.html
@@ -5,7 +5,7 @@
     <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css">
     <title>Canvas Dialog</title>
   </head>
-  <body>
+  <body class="dialog_body">
     <div class="container noselect">
     <form> 
 
@@ -80,7 +80,7 @@
 
       <fieldset class="canvas"> 
         <legend data-i18n="canvas.prop.heading.data_scaling"></legend> 
-
+<div style="display: inline-block; align: left;">
           <div class="x-scale prop hidden">
             <label class="no_gop_opt" data-i18n="[title]canvas.prop.x_scale_tt">
               <span data-i18n="canvas.prop.x_scale"></span>
@@ -122,7 +122,7 @@
          </label>
        </div>
     </div>
-
+</div>
       </fieldset> 
 
 
@@ -140,7 +140,8 @@
               <input onchange="attr_change(this);"
                      class="array-name"
                      type="text"
-                     name="array_name">
+                     name="array_name"
+                     id="array_name_input">
             </label>
             <label class="array-size"
                    data-i18n="[title]canvas.prop.array_size_tt">
@@ -170,50 +171,60 @@
 
             <span data-i18n="canvas.prop.array_style"></span>
             <br/>
-            <label class="polygon"
-                   data-i18n="[title]canvas.prop.array_polygon_tt">
-              <input class="array-style"
-                     type="radio"
-                     id="polygon"
-                     value="0"
-                     name="array_style"
-                     onchange="flag_change(this);">
-              <span data-i18n="canvas.prop.array_polygon"></span>
-            </label>
-            <br/>
-            <label class="points"
-                   data-i18n="[title]canvas.prop.array_points_tt">
-              <input class="array-style"
-                     type="radio"
-                     id="points"
-                     value="1"
-                     name="array_style"
-                     onchange="flag_change(this);">
-              <span data-i18n="canvas.prop.array_points"></span>
-            </label>
-            <br/>
-            <label class="bezier-curve"
-                   data-i18n="[title]canvas.prop.array_bezier_tt">
-              <input class="array-style"
-                     type="radio"
-                     id="bezier"
-                     value="2"
-                     name="array_style"
-                     onchange="flag_change(this);">
-              <span data-i18n="canvas.prop.array_bezier"></span>
-            </label>
-            <br/>
-            <label class="bar-graph"
-                   data-i18n="[title]canvas.prop.array_bars_tt">
-              <input class="array-style"
-                     type="radio"
-                     id="bar-graph"
-                     value="3"
-                     name="array_style"
-                     onchange="flag_change(this);">
-              <span data-i18n="canvas.prop.array_bars"></span>
-            </label>
-            <br/>
+            <table class="array_style">
+              <tr>
+                <td>
+                  <label class="polygon"
+                         data-i18n="[title]canvas.prop.array_polygon_tt">
+                    <input class="array-style"
+                           type="radio"
+                           id="polygon"
+                           value="0"
+                           name="array_style"
+                           onchange="flag_change(this);">
+                    <span data-i18n="canvas.prop.array_polygon"></span>
+                  </label>
+                </td>
+                <td>
+                  <label class="points"
+                         data-i18n="[title]canvas.prop.array_points_tt">
+                    <input class="array-style"
+                           type="radio"
+                           id="points"
+                           value="1"
+                           name="array_style"
+                           onchange="flag_change(this);">
+                    <span data-i18n="canvas.prop.array_points"></span>
+                  </label>
+                </td>
+              </tr>
+              <tr>
+                <td>
+                  <label class="bezier-curve"
+                         data-i18n="[title]canvas.prop.array_bezier_tt">
+                    <input class="array-style"
+                           type="radio"
+                           id="bezier"
+                           value="2"
+                           name="array_style"
+                           onchange="flag_change(this);">
+                    <span data-i18n="canvas.prop.array_bezier"></span>
+                  </label>
+                </td>
+                <td>
+                  <label class="bar-graph"
+                         data-i18n="[title]canvas.prop.array_bars_tt">
+                    <input class="array-style"
+                           type="radio"
+                           id="bar-graph"
+                           value="3"
+                           name="array_style"
+                           onchange="flag_change(this);">
+                    <span data-i18n="canvas.prop.array_bars"></span>
+                  </label>
+                </td>
+              </tr>
+            </table>
           </div>
 
       <div class="array-fill">
@@ -623,7 +634,7 @@ function init_arrays(attr_objects) {
     if (attr_objects.length) {
         // populate form with first array
         populate_array_form(attr_objects);
-        // disable x1 and x2 for garrays-- they
+        // hide x1 and x2 for garrays-- they
         // automatically get set to the array size
         document.getElementsByName("x1")[0].disabled = true;
         document.getElementsByName("x2")[0].disabled = true;
diff --git a/pd/nw/dialog_font.html b/pd/nw/dialog_font.html
index 967f02a3b..d4cddce41 100644
--- a/pd/nw/dialog_font.html
+++ b/pd/nw/dialog_font.html
@@ -3,7 +3,7 @@
   <head>
     <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css">
   </head>
-  <body id="iemgui_dialog_body">
+  <body class="dialog_body">
     <div class="container">
     <form> 
       <fieldset> 
diff --git a/pd/nw/dialog_gatom.html b/pd/nw/dialog_gatom.html
index cf6e4b5d3..10f246943 100644
--- a/pd/nw/dialog_gatom.html
+++ b/pd/nw/dialog_gatom.html
@@ -3,7 +3,7 @@
   <head>
     <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css">
   </head>
-  <body id="iemgui_dialog_body">
+  <body id="dialog_body">
     <div class="container">
     <form> 
       <fieldset> 
diff --git a/pd/nw/dialog_iemgui.html b/pd/nw/dialog_iemgui.html
index ed7e52bde..8c103907b 100644
--- a/pd/nw/dialog_iemgui.html
+++ b/pd/nw/dialog_iemgui.html
@@ -4,7 +4,7 @@
     <link id="page_style" rel="stylesheet"
           type="text/css" href="css/default.css">
   </head>
-  <body id="iemgui_dialog_body">
+  <body class="dialog_body">
     <div class="container">
     <form> 
       <fieldset> 
diff --git a/pd/nw/dialog_prefs.html b/pd/nw/dialog_prefs.html
index 78b107c5b..6d00bcf4b 100644
--- a/pd/nw/dialog_prefs.html
+++ b/pd/nw/dialog_prefs.html
@@ -3,7 +3,7 @@
   <head>
     <link id="page_style" rel="stylesheet" type="text/css" href="css/default.css">
   </head>
-  <body>
+  <body class="dialog_body">
     <div class="container noselect">
       <div class="menu">
         <span data-i18n="[title]prefs.heading.audio_tt">
diff --git a/pd/nw/locales/en/translation.json b/pd/nw/locales/en/translation.json
index e80178beb..ffa68d4bb 100644
--- a/pd/nw/locales/en/translation.json
+++ b/pd/nw/locales/en/translation.json
@@ -264,7 +264,7 @@
       },
       "gop": "graph on parent",
       "gop_tt": "show the inner contents of this canvas in a rectangle on the containing canvas",
-      "hide_name": "hide object name and arguments",
+      "hide_name": "hide name and arguments",
       "hide_name_tt": "hide the text that appears in the object box",
       "gop_0": "Object",
       "gop_1": "Window",
diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index 27037d46a..7618b521e 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -3276,7 +3276,7 @@ function gui_canvas_dialog(did, attr_arrays) {
             }
         }
     }
-    dialogwin[did] = nw_create_window(did, "canvas", 250, 100,
+    dialogwin[did] = nw_create_window(did, "canvas", 300, 100,
         popup_coords[2], popup_coords[3],
         attr_arrays);
 }
@@ -3290,7 +3290,7 @@ function gui_remove_gfxstub(did) {
 
 function gui_font_dialog(cid, gfxstub, font_size) {
     var attrs = { canvas: cid, font_size: font_size };
-    dialogwin[gfxstub] = nw_create_window(gfxstub, "font", 265, 265, 0, 0,
+    dialogwin[gfxstub] = nw_create_window(gfxstub, "font", 265, 200, 0, 0,
         attrs);
 }
 
@@ -3304,7 +3304,7 @@ function gui_pd_dsp(state) {
 
 function open_prefs() {
     if (!dialogwin["prefs"]) {
-        nw_create_window("prefs", "prefs", 265, 540, 0, 0, null);
+        nw_create_window("prefs", "prefs", 265, 350, 0, 0, null);
     }
 }
 
-- 
GitLab