I wanted to have a 4x4 Launcher layout, but wasn't happy with the patches currently available. The icons and text are resized too small for my tastes, especially on the relatively small screen size of the Pre.
I spent a while tweaking the parameters of two launcher files to create a 4x4 launcher layout that keeps the icons the same size as the originals and reduces the font size by only 1 point (from 14px to 13px). It wraps the app title as well.
UPDATE (10/14/2009): I fixed the missing page indicator on the right, and believe to have fixed the down arrow appearing even when a page has no more than 16 icons. Only launcher-assistant.jsjsjs $has$ $changed$.
I encourage someone to create a patch based on my 4x4 layout and add it to the Preware patches feed. You're even more than welcome to take credit for the patch.
/usr/lib/luna/system/luna-applauncher/app/controllers/launcher-assistant.jsjsjs
Code:
--- launcher-assistant.jsjsjs.$orig$ $Mon$ $Oct$ $12$ $21$:$08$:$49$ $2009$
+++ $launcher$-$assistant$.$js$ $Wed$ $Oct$ $14$ $10$:$15$:$05$ $2009$
@@ -$10$,$8$ +$10$,$8$ @@
*/
$kQuickLaunchHeight$: $67$,
- $kPageIndicatorSpacing$: $6$, /* $spacing$ $between$ $each$ $page$ $indicator$ */
- $kPageMargin$: $10$, /* $10$ $pixel$ $margin$ $on$ $each$ $side$ $of$ $a$ $page$ */
+ $kPageIndicatorSpacing$: $1$, /* $spacing$ $between$ $each$ $page$ $indicator$ */
+ $kPageMargin$: $0$, /* $0$ $pixel$ $margin$ $on$ $each$ $side$ $of$ $a$ $page$ */
$kPageWidthNoMargin$: $NaN$,
$kPageWidth$: $NaN$,
$kAppsPerRow$: $NaN$,
@@ -$89$,$7$ +$89$,$8$ @@
// $pre$-$calculate$ $commonly$ $used$ $measurements$
$this$.$kPageWidth$ = $('$launcher_root$').$getWidth$();
- $this$.$kPageWidthNoMargin$ = ($this$.$kPageWidth$ - $this$.$kPageMargin$ * $2$);
+ $this$.$kPageWidthNoMargin$ = ($this$.$kPageWidth$ - $20$);
// $setup$ $the$ $initial$ $dimensions$ $for$ $launcher$/$global$-$search$
$this$.$adjustLayout$();
@@ -$322$,$9$ +$323$,$9$ @@
$var$ $newAppDiv$ = $($newAppInfo$.$launchPointId$);
$Mojo$.$assert$($newAppDiv$ !== $undefined$, &$quot$;$Application$ (%$d$) $was$ $inserted$ $into$ $the$ $DOM$ $but$ $unable$ $to$ $be$ $retrieved$!&$quot$;, $newAppInfo$.$launchPointId$);
$if$ ($isNaN$($this$.$kAppWidth$) || $isNaN$($this$.$kAppHeight$)) {
- $this$.$kAppWidth$ = $newAppDiv$.$getWidth$();
- $this$.$kAppHeight$ = $newAppDiv$.$getHeight$();
- $this$.$kAppsPerRow$ = $Math$.$round$($this$.$kPageWidthNoMargin$ / $this$.$kAppWidth$);
+ $this$.$kAppWidth$ = $80$;
+ $this$.$kAppHeight$ = $92$;
+ $this$.$kAppsPerRow$ = $4$;
}
$Mojo$.$listen$($newAppDiv$, $Mojo$.$Event$.$tap$, $this$.$onAppTapped$.$bindAsEventListener$($this$));
@@ -$437$,$8$ +$438$,$8$ @@
/* $determines$ $the$ $position$ $of$ $an$ $app$ $element$ $at$ $appIndex$ $within$ $a$ $page$ */
$calculateAppPosition$: $function$($appIndex$) {
$return$ {
- $left$: ((($appIndex$ % $this$.$kAppsPerRow$) * $this$.$kAppWidth$) + $this$.$kPageMargin$),
- $top$: ($Math$.$floor$($appIndex$/$this$.$kAppsPerRow$) * $this$.$kAppHeight$)
+ $left$: ((($appIndex$ % $this$.$kAppsPerRow$) * $this$.$kAppWidth$) - $10$),
+ $top$: (($Math$.$floor$($appIndex$/$this$.$kAppsPerRow$) * $this$.$kAppHeight$) - $8$)
};
},
/usr/lib/luna/system/luna-applauncher/stylesheets/launcher.css
Code:
--- launcher.css.orig Mon Oct 12 21:05:19 2009
+++ launcher.css Mon Oct 12 21:08:34 2009
@@ -121,16 +121,17 @@
.launcher_page .name {
position:absolute;
- top: 68px;
- width:100px;
- height: 34px;
- max-height: 34px;
+ top: 62px;
+ left: 11px;
+ width:78px;
+ height: 28px;
+ max-height: 28px;
clear:both;
- line-height:16px;
+ line-height:13px;
color:white;
text-align:center;
font-weight:bold;
- font-size: 14px;
+ font-size: 13px;
overflow: hidden;
text-overflow: ellipsis;
z-index:5;