From 591b9205365e6bc1cefece2e0a05f29b9cddee32 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Wed, 11 Mar 2015 11:17:15 -0500 Subject: Reduce themes to 5 and rely on scaling This will significantly reduce theme maintainence and should be a lot more sustainable over time. Eliminate most themes leaving only 5 remaining in 3 categores: * watch_mdpi: 320x320 * portrait_mdpi: 480x800 * portrait_hdpi: 1080x1920 * landscape_mdpi: 800x480 * landscape_hdpi: 1920x1200 Add handling to map the old DEVICE RESOLUTION to the new TW_THEME build flag. New devices should specify a theme using the new TW_THEME build flag using one of the 5 values from the list above. Long term we will eliminate the use of the DEVICE_RESOLUTION flag in favor of the new flag. Change the way sliders render so that they completely follow the placement="5". This will probably break some custom themes but is necessary so that we can retain the aspect ratio on slider images and still have them rendered at the center of the screen. Add code to the console slideout button so that it can be centered. Centering the slideout button allows us to keep the button at the center of the screen when retaining aspect ratios on the image. Add more retain aspect ratios for home, back, slideout, folder, file, and lock screen images. Change the way we build the top bar in TWRP. It is now mostly drawn using fill objects and the TWRP logo is a separate image so that we can retain its aspect ratio during scaling. Thanks to Mark Norelus for providing the TWRP logo. Change-Id: I801a7b3163cad9ef353461f4c327690a9ccbb3aa --- gui/console.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gui/console.cpp') diff --git a/gui/console.cpp b/gui/console.cpp index b1b025c48..1544d77a1 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -130,7 +130,7 @@ GUIConsole::GUIConsole(xml_node<>* node) : GUIScrollList(node) { mSlideout = 1; mSlideoutState = hidden; - LoadPlacement(child, &mSlideoutX, &mSlideoutY); + LoadPlacement(child, &mSlideoutX, &mSlideoutY, &mSlideoutW, &mSlideoutH, &mPlacement); mSlideoutImage = LoadAttrImage(child, "resource"); @@ -138,6 +138,12 @@ GUIConsole::GUIConsole(xml_node<>* node) : GUIScrollList(node) { mSlideoutW = mSlideoutImage->GetWidth(); mSlideoutH = mSlideoutImage->GetHeight(); + if (mPlacement == CENTER || mPlacement == CENTER_X_ONLY) { + mSlideoutX = mSlideoutX - (mSlideoutW / 2); + if (mPlacement == CENTER) { + mSlideoutY = mSlideoutY - (mSlideoutH / 2); + } + } } } } -- cgit v1.2.3