Bugzilla – Attachment 660631 Details for
Bug 960485
New TW branding does not fit screen size
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
Proposed patch
plymouth-scale-background-image.patch (text/plain), 3.09 KB, created by
Antoine Belvire
on 2016-01-03 23:19:56 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Antoine Belvire
Created:
2016-01-03 23:19:56 UTC
Size:
3.09 KB
patch
obsolete
>From aef0d460ba57358fa4b320538e134e55f0db6e6d Mon Sep 17 00:00:00 2001 >From: Antoine Belvire <antoine.belvire@laposte.net> >Date: Sat, 2 Jan 2016 14:38:29 +0100 >Subject: [PATCH] [plymouth] Scale background image Same problem on Tumbleweed > since last snapshot, please merge pr #56... > >--- > boot/plymouth/theme/openSUSE.script | 28 +++++++++++++++++++++++----- > 1 file changed, 23 insertions(+), 5 deletions(-) > >diff --git a/boot/plymouth/theme/openSUSE.script b/boot/plymouth/theme/openSUSE.script >index 0d1f7db..d4ffba0 100644 >--- a/boot/plymouth/theme/openSUSE.script >+++ b/boot/plymouth/theme/openSUSE.script >@@ -1,3 +1,4 @@ >+#-------------------------------- Own functions -------------------------------- > Window.GetMaxWidth = fun (){ > i = 0; > width = 800; # minimum >@@ -10,7 +11,7 @@ Window.GetMaxWidth = fun (){ > > Window.GetMaxHeight = fun (){ > i = 0; >- height = 600; # minium >+ height = 600; # minimum > while (Window.GetHeight(i)){ > height = Math.Max(height, Window.GetHeight(i)); > i++; >@@ -18,6 +19,24 @@ Window.GetMaxHeight = fun (){ > return height; > }; > >+Window.ComputeScaleFactor = fun(image_to_scale){ >+ >+ screen_ratio = Window.GetHeight() / Window.GetWidth(); >+ image_ratio = image_to_scale.GetHeight() / image_to_scale.GetWidth(); >+ >+ if (screen_ratio > image_ratio) { >+ # Screen ratio is taller than image ratio, we will match the screen height >+ scale_factor = Window.GetHeight() / image_to_scale.GetHeight(); >+ } >+ else { >+ # Screen ratio is wider than image ratio, we will match the screen width >+ scale_factor = Window.GetWidth() / image_to_scale.GetWidth(); >+ } >+ >+ return scale_factor; >+}; >+ >+#--------------------------------------- Main ---------------------------------- > > if (Plymouth.GetMode() == "suspend" || Plymouth.GetMode() == "resume") { > background.original_image = ImageNew("suspend.png"); >@@ -46,8 +65,7 @@ else { > > } > >-# for now we just take the image as it is - no up or down scaling >-scale_factor = 1; >+scale_factor = Window.ComputeScaleFactor(background.original_image) | 1; > > background.image = background.original_image.Scale(background.original_image.GetWidth() * scale_factor, > background.original_image.GetHeight() * scale_factor); >@@ -76,7 +94,7 @@ if (Plymouth.GetMode() != "suspend" && Plymouth.GetMode() != "resume") { > Plymouth.SetRefreshFunction (refresh_callback); > } > >-#----------------------------------------- Dialog -------------------------------- >+#----------------------------------------- Dialog ------------------------------ > > status = "normal"; > >@@ -190,7 +208,7 @@ Plymouth.SetDisplayNormalFunction(display_normal_callback); > Plymouth.SetDisplayPasswordFunction(display_password_callback); > Plymouth.SetMessageFunction(display_message_callback); > >-#----------------------------------------- Progress Bar -------------------------------- >+#----------------------------------------- Progress Bar ------------------------ > > if (Plymouth.GetMode() == "suspend" || Plymouth.GetMode() == "resume") { > progress_box.original_image = ImageNew("progress_box_background.png");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 960485
: 660631