Bug 669392 - File and Directory paths should be cropped in the middle and not at the beginning of the path; r=Unfocused
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 17 Aug 2011 14:03:28 +1200
changeset 86293 2d9846b8eb2893451a84188795add1a9e6ad79bb
parent 86292 40bc6b9b09d1742924e7169b71be01d5260a1fd2
child 86294 b6c3441ce15354bde092592721b77d4fc73127f7
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused
bugs669392
milestone12.0a1
Bug 669392 - File and Directory paths should be cropped in the middle and not at the beginning of the path; r=Unfocused
toolkit/mozapps/extensions/content/setting.xml
toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
toolkit/themes/pinstripe/mozapps/extensions/extensions.css
toolkit/themes/winstripe/mozapps/extensions/extensions.css
--- a/toolkit/mozapps/extensions/content/setting.xml
+++ b/toolkit/mozapps/extensions/content/setting.xml
@@ -397,17 +397,17 @@
       <xul:vbox class="setting-label">
         <xul:label class="preferences-title" xbl:inherits="xbl:text=title" flex="1"/>
         <xul:label class="preferences-description" xbl:inherits="xbl:text=desc" flex="1">
           <children/>
         </xul:label>
       </xul:vbox>
       <xul:hbox anonid="input-container" align="center" class="setting-input">
         <xul:button type="button" anonid="button" label="&settings.path.button.label;" xbl:inherits="disabled" oncommand="showPicker();" />
-        <xul:label anonid="input" flex="1" crop="start" xbl:inherits="disabled" />
+        <xul:label anonid="input" flex="1" crop="center" xbl:inherits="disabled" />
       </xul:hbox>
     </content>
 
     <implementation>
       <method name="showPicker">
         <body>
         <![CDATA[
           var filePicker = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
@@ -461,16 +461,17 @@
           let label = "";
           if (val) {
             try {
               let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
               file.initWithPath(val);
               label = this.hasAttribute("fullpath") ? file.path : file.leafName;
             } catch (e) {}
           }
+          this.input.tooltipText = val;
           return this.input.value = label;
        ]]>
         </setter>
       </property>
     </implementation>
   </binding>
 
   <binding id="setting-multi" extends="chrome://mozapps/content/extensions/setting.xml#setting-base">
--- a/toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
@@ -237,51 +237,57 @@ add_test(function() {
     is(input.color, "#FF9900", "Color picker should have updated value");
     is(Services.prefs.getCharPref("extensions.inlinesettings1.color"), "#FF9900", "Color pref should have been updated");
 
     try {
       ok(!settings[6].hasAttribute("first-row"), "Not the first row");
       var button = gManagerWindow.document.getAnonymousElementByAttribute(settings[6], "anonid", "button");
       input = gManagerWindow.document.getAnonymousElementByAttribute(settings[6], "anonid", "input");
       is(input.value, "", "Label value should be empty");
+      is(input.tooltipText, "", "Label tooltip should be empty");
 
       var profD = Services.dirsvc.get("ProfD", Ci.nsIFile);
       var curProcD = Services.dirsvc.get("CurProcD", Ci.nsIFile);
 
       MockFilePicker.returnFiles = [profD];
       MockFilePicker.returnValue = Ci.nsIFilePicker.returnOK;
       EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
       is(MockFilePicker.mode, Ci.nsIFilePicker.modeOpen, "File picker mode should be open file");
       is(input.value, profD.path, "Label value should match file chosen");
+      is(input.tooltipText, profD.path, "Label tooltip should match file chosen");
       is(Services.prefs.getCharPref("extensions.inlinesettings1.file"), profD.path, "File pref should match file chosen");
 
       MockFilePicker.returnFiles = [curProcD];
       MockFilePicker.returnValue = Ci.nsIFilePicker.returnCancel;
       EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
       is(MockFilePicker.mode, Ci.nsIFilePicker.modeOpen, "File picker mode should be open file");
       is(input.value, profD.path, "Label value should not have changed");
+      is(input.tooltipText, profD.path, "Label tooltip should not have changed");
       is(Services.prefs.getCharPref("extensions.inlinesettings1.file"), profD.path, "File pref should not have changed");
 
       ok(!settings[7].hasAttribute("first-row"), "Not the first row");
       button = gManagerWindow.document.getAnonymousElementByAttribute(settings[7], "anonid", "button");
       input = gManagerWindow.document.getAnonymousElementByAttribute(settings[7], "anonid", "input");
       is(input.value, "", "Label value should be empty");
+      is(input.tooltipText, "", "Label tooltip should be empty");
 
       MockFilePicker.returnFiles = [profD];
       MockFilePicker.returnValue = Ci.nsIFilePicker.returnOK;
       EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
       is(MockFilePicker.mode, Ci.nsIFilePicker.modeGetFolder, "File picker mode should be directory");
       is(input.value, profD.path, "Label value should match file chosen");
+      is(input.tooltipText, profD.path, "Label tooltip should match file chosen");
       is(Services.prefs.getCharPref("extensions.inlinesettings1.directory"), profD.path, "Directory pref should match file chosen");
 
       MockFilePicker.returnFiles = [curProcD];
       MockFilePicker.returnValue = Ci.nsIFilePicker.returnCancel;
       EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 }, gManagerWindow);
       is(MockFilePicker.mode, Ci.nsIFilePicker.modeGetFolder, "File picker mode should be directory");
       is(input.value, profD.path, "Label value should not have changed");
+      is(input.tooltipText, profD.path, "Label tooltip should not have changed");
       is(Services.prefs.getCharPref("extensions.inlinesettings1.directory"), profD.path, "Directory pref should not have changed");
 
     } finally {
       button = gManagerWindow.document.getElementById("detail-prefs-btn");
       is_element_hidden(button, "Preferences button should not be visible");
 
       gCategoryUtilities.openType("extension", run_next_test);
     }
--- a/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
@@ -719,16 +719,17 @@
   color: GrayText;
 }
 
 #detail-grid {
   margin-bottom: 2em;
 }
 
 #detail-grid > columns > column:first-child {
+  min-width: 15em;
   max-width: 25em;
 }
 
 .detail-row[first-row="true"],
 .detail-row-complex[first-row="true"],
 setting[first-row="true"] {
   border-top: none;
 }
--- a/toolkit/themes/pinstripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/pinstripe/mozapps/extensions/extensions.css
@@ -897,16 +897,17 @@
               0 0 2px rgba(0, 0, 0, 0.4) inset;
 }
 
 #detail-grid {
   margin-bottom: 2em;
 }
 
 #detail-grid > columns > column:first-child {
+  min-width: 15em;
   max-width: 25em;
 }
 
 .detail-row[first-row="true"],
 .detail-row-complex[first-row="true"],
 setting[first-row="true"] {
   border-top: none;
 }
--- a/toolkit/themes/winstripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/winstripe/mozapps/extensions/extensions.css
@@ -876,16 +876,17 @@
               0 1px 0 rgba(255, 255, 255, 0.4);
 }
 
 #detail-grid {
   margin-bottom: 2em;
 }
 
 #detail-grid > columns > column:first-child {
+  min-width: 15em;
   max-width: 25em;
 }
 
 .detail-row[first-row="true"],
 .detail-row-complex[first-row="true"],
 setting[first-row="true"] {
   border-top: none;
 }