diff options
-rw-r--r-- | gui/fileselector.cpp | 8 | ||||
-rw-r--r-- | gui/listbox.cpp | 8 | ||||
-rw-r--r-- | minui/Android.mk | 12 | ||||
-rw-r--r-- | minui/graphics.c | 8 | ||||
-rw-r--r-- | minuitwrp/graphics.c | 10 | ||||
-rw-r--r-- | partition.cpp | 19 | ||||
-rw-r--r-- | partitionmanager.cpp | 3 |
7 files changed, 41 insertions, 27 deletions
diff --git a/gui/fileselector.cpp b/gui/fileselector.cpp index 0f8d903a3..b7804fd86 100644 --- a/gui/fileselector.cpp +++ b/gui/fileselector.cpp @@ -659,7 +659,7 @@ int GUIFileSelector::GetSelection(int x, int y) int GUIFileSelector::NotifyTouch(TOUCH_STATE state, int x, int y) { - static int lastY = 0, last2Y = 0; + static int lastY = 0, last2Y = 0, fastScroll = 0; int selection = 0; switch (state) @@ -674,6 +674,9 @@ int GUIFileSelector::NotifyTouch(TOUCH_STATE state, int x, int y) mUpdate = 1; startY = lastY = last2Y = y; scrollingSpeed = 0; + + if(mFastScrollRectX != -1 && x >= mRenderX + mRenderW - mFastScrollW) + fastScroll = 1; break; case TOUCH_DRAG: // Check if we dragged out of the selection window @@ -687,7 +690,7 @@ int GUIFileSelector::NotifyTouch(TOUCH_STATE state, int x, int y) } // Fast scroll - if(mFastScrollRectX != -1 && x >= mRenderX + mRenderW - mFastScrollW) + if(fastScroll) { int pct = ((y-mRenderY-mHeaderH)*100)/(mRenderH-mHeaderH); int totalSize = (mShowFolders ? mFolderList.size() : 0) + (mShowFiles ? mFileList.size() : 0); @@ -761,6 +764,7 @@ int GUIFileSelector::NotifyTouch(TOUCH_STATE state, int x, int y) case TOUCH_RELEASE: isHighlighted = false; + fastScroll = 0; if (startSelection >= 0) { // We've selected an item! diff --git a/gui/listbox.cpp b/gui/listbox.cpp index a4976f4e1..670966401 100644 --- a/gui/listbox.cpp +++ b/gui/listbox.cpp @@ -602,7 +602,7 @@ int GUIListBox::GetSelection(int x, int y) int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y) { - static int lastY = 0, last2Y = 0; + static int lastY = 0, last2Y = 0, fastScroll = 0; int selection = 0; switch (state) @@ -617,6 +617,9 @@ int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y) mUpdate = 1; startY = lastY = last2Y = y; scrollingSpeed = 0; + + if(mFastScrollRectX != -1 && x >= mRenderX + mRenderW - mFastScrollW) + fastScroll = 1; break; case TOUCH_DRAG: @@ -631,7 +634,7 @@ int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y) } // Fast scroll - if(mFastScrollRectX != -1 && x >= mRenderX + mRenderW - mFastScrollW) + if(fastScroll) { int pct = ((y-mRenderY-mHeaderH)*100)/(mRenderH-mHeaderH); int totalSize = mList.size(); @@ -705,6 +708,7 @@ int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y) case TOUCH_RELEASE: isHighlighted = false; + fastScroll = 0; if (startSelection >= 0) { // We've selected an item! diff --git a/minui/Android.mk b/minui/Android.mk index d8895873e..704e54177 100644 --- a/minui/Android.mk +++ b/minui/Android.mk @@ -31,8 +31,16 @@ else LOCAL_CFLAGS += -DOVERSCAN_PERCENT=0 endif -ifneq ($(TARGET_RECOVERY_LCD_BACKLIGHT_PATH),) - LOCAL_CFLAGS += -DRECOVERY_LCD_BACKLIGHT_PATH=$(TARGET_RECOVERY_LCD_BACKLIGHT_PATH) +ifneq ($(TW_BRIGHTNESS_PATH),) + LOCAL_CFLAGS += -DTW_BRIGHTNESS_PATH=\"$(TW_BRIGHTNESS_PATH)\" +endif +ifneq ($(TW_MAX_BRIGHTNESS),) + LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=$(TW_MAX_BRIGHTNESS) +else + LOCAL_CFLAGS += -DTW_MAX_BRIGHTNESS=255 +endif +ifneq ($(TW_NO_SCREEN_BLANK),) + LOCAL_CFLAGS += -DTW_NO_SCREEN_BLANK endif include $(BUILD_STATIC_LIBRARY) diff --git a/minui/graphics.c b/minui/graphics.c index ff3967496..00fbb1eef 100644 --- a/minui/graphics.c +++ b/minui/graphics.c @@ -437,15 +437,17 @@ gr_pixel *gr_fb_data(void) void gr_fb_blank(bool blank) { -#ifdef RECOVERY_LCD_BACKLIGHT_PATH +#if defined(TW_NO_SCREEN_BLANK) && defined(TW_BRIGHTNESS_PATH) && defined(TW_MAX_BRIGHTNESS) int fd; + char brightness[4]; + snprintf(brightness, 4, "%03d", TW_MAX_BRIGHTNESS/2); - fd = open(RECOVERY_LCD_BACKLIGHT_PATH, O_RDWR); + fd = open(TW_BRIGHTNESS_PATH, O_RDWR); if (fd < 0) { perror("cannot open LCD backlight"); return; } - write(fd, blank ? "000" : "127", 3); + write(fd, blank ? "000" : brightness, 3); close(fd); #else int ret; diff --git a/minuitwrp/graphics.c b/minuitwrp/graphics.c index fc34b6b19..99f584183 100644 --- a/minuitwrp/graphics.c +++ b/minuitwrp/graphics.c @@ -69,6 +69,7 @@ static GGLSurface gr_framebuffer[NUM_BUFFERS]; static GGLSurface gr_mem_surface; static unsigned gr_active_fb = 0; static unsigned double_buffering = 0; +static int gr_is_curr_clr_opaque = 0; static int gr_fb_fd = -1; static int gr_vt_fd = -1; @@ -288,6 +289,8 @@ void gr_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a color[2] = ((b << 8) | b) + 1; color[3] = ((a << 8) | a) + 1; gl->color4xv(gl, color); + + gr_is_curr_clr_opaque = (a == 255); } int gr_measureEx(const char *s, void* font) @@ -463,8 +466,15 @@ int twgr_text(int x, int y, const char *s) void gr_fill(int x, int y, int w, int h) { GGLContext *gl = gr_context; + + if(gr_is_curr_clr_opaque) + gl->disable(gl, GGL_BLEND); + gl->disable(gl, GGL_TEXTURE_2D); gl->recti(gl, x, y, x + w, y + h); + + if(gr_is_curr_clr_opaque) + gl->enable(gl, GGL_BLEND); } void gr_blit(gr_surface source, int sx, int sy, int w, int h, int dx, int dy) { diff --git a/partition.cpp b/partition.cpp index 541289a0b..95f6bcac4 100644 --- a/partition.cpp +++ b/partition.cpp @@ -361,10 +361,6 @@ bool TWPartition::Process_Fstab_Line(string Line, bool Display_Error) { Is_Storage = true; Removable = true; Wipe_Available_in_GUI = true; -#ifndef RECOVERY_SDCARD_ON_DATA - Setup_AndSec(); - Mount_Storage_Retry(); -#endif #endif } #ifdef TW_INTERNAL_STORAGE_PATH @@ -373,20 +369,12 @@ bool TWPartition::Process_Fstab_Line(string Line, bool Display_Error) { Is_Settings_Storage = true; Storage_Path = EXPAND(TW_INTERNAL_STORAGE_PATH); Wipe_Available_in_GUI = true; -#ifndef RECOVERY_SDCARD_ON_DATA - Setup_AndSec(); - Mount_Storage_Retry(); -#endif } #else if (Mount_Point == "/emmc" || Mount_Point == "/internal_sd" || Mount_Point == "/internal_sdcard") { Is_Storage = true; Is_Settings_Storage = true; Wipe_Available_in_GUI = true; -#ifndef RECOVERY_SDCARD_ON_DATA - Setup_AndSec(); - Mount_Storage_Retry(); -#endif } #endif } else if (Is_Image(Fstab_File_System)) { @@ -663,6 +651,7 @@ void TWPartition::Setup_AndSec(void) { Backup_Path = Symlink_Mount_Point; Make_Dir("/and-sec", true); Recreate_AndSec_Folder(); + Mount_Storage_Retry(); } void TWPartition::Find_Real_Block_Device(string& Block, bool Display_Error) { @@ -1602,12 +1591,6 @@ bool TWPartition::Backup_Tar(string backup_folder) { tar.setsize(Backup_Size); if (tar.createTarFork() != 0) return false; - if (use_encryption) - Full_FileName += "000"; - if (TWFunc::Get_File_Size(Full_FileName) == 0) { - LOGERR("Backup file size for '%s' is 0 bytes.\n", Full_FileName.c_str()); - return false; - } return true; } diff --git a/partitionmanager.cpp b/partitionmanager.cpp index 091ae3288..04dbee967 100644 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -96,6 +96,9 @@ int TWPartitionManager::Process_Fstab(string Fstab_Filename, bool Display_Error) for (iter = Partitions.begin(); iter != Partitions.end(); iter++) { if ((*iter)->Is_Storage) { (*iter)->Is_Settings_Storage = true; +#ifndef RECOVERY_SDCARD_ON_DATA + (*iter)->Setup_AndSec(); +#endif Found_Settings_Storage = true; DataManager::SetValue("tw_settings_path", (*iter)->Storage_Path); DataManager::SetValue("tw_storage_path", (*iter)->Storage_Path); |