Skip to content

Commit b11016d

Browse files
committed
fix: mobile detection
1 parent 7a7c14f commit b11016d

File tree

2 files changed

+39
-32
lines changed

2 files changed

+39
-32
lines changed

src/gui/src/UI/UITaskbar.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ async function UITaskbar(options){
9494
apps_str += `<input style="background-image:url('${window.icons['magnifier-outline.svg']}');" class="launch-search">`;
9595
apps_str += `<img class="launch-search-clear" src="${window.icons['close.svg']}">`;
9696
apps_str += `</div>`;
97+
9798
// -------------------------------------------
9899
// Recent apps
99100
// -------------------------------------------
@@ -307,13 +308,14 @@ window.make_taskbar_sortable = function(){
307308
window.recalibrate_taskbar_item_positions = function(){
308309
// if this is mobile rearrange taskbar item positions based on absolute position
309310
// taskbar items must be centered unless there is overflow. If there is overflow, the taskbar items must be left aligned
310-
if(isMobile.phone){
311+
if(isMobile.phone || window.desktop_width < 800){
311312
let taskbar_items = $('.taskbar-item');
312313
let taskbar_width = taskbar_items.length * 60;
313314

314315
if(taskbar_width > window.desktop_width){
315316
// set taskbar items to absolute position
316317
$('.taskbar-item').css('position', 'absolute');
318+
$('.taskbar').css('display', 'block');
317319
// set left position for each taskbar item
318320
let left = 0;
319321
for (let index = 0; index < taskbar_items.length; index++) {

src/gui/src/css/style.css

+36-31
Original file line numberDiff line numberDiff line change
@@ -2412,38 +2412,43 @@ label {
24122412
}
24132413
}
24142414

2415-
.device-phone .taskbar {
2416-
justify-content: center;
2417-
overflow: visible !important;
2418-
overflow-x: scroll !important;
2419-
}
2420-
2421-
.device-phone .taskbar .taskbar-item, .device-phone .taskbar .taskbar-item-sortable-placeholder {
2422-
width: 40px !important;
2423-
height: 40px !important;
2424-
margin-right: 5px;
2425-
overflow: visible !important;
2426-
padding: 5px 5px 10px 5px;
2427-
position: absolute;
2428-
}
2429-
2430-
.device-phone .taskbar-icon {
2431-
height: 40px;
2432-
width: 40px;
2433-
}
2434-
2435-
/* Hide scrollbar for Chrome, Safari and Opera */
2436-
.device-phone .taskbar ::-webkit-scrollbar {
2437-
width: 0 !important;
2438-
display: none;
2439-
}
2415+
@media screen and (max-width: 768px) {
24402416

2441-
/* Hide scrollbar for IE, Edge and Firefox */
2442-
.device-phone .taskbar {
2443-
-ms-overflow-style: none;
2444-
/* IE and Edge */
2445-
scrollbar-width: none;
2446-
/* Firefox */
2417+
.taskbar {
2418+
justify-content: center;
2419+
overflow: visible !important;
2420+
overflow-x: scroll !important;
2421+
overflow-y: hidden !important;
2422+
}
2423+
2424+
.taskbar .taskbar-item, .taskbar .taskbar-item-sortable-placeholder {
2425+
width: 40px !important;
2426+
height: 40px !important;
2427+
margin-right: 5px;
2428+
overflow: visible !important;
2429+
padding: 5px 5px 10px 5px;
2430+
position: absolute;
2431+
}
2432+
2433+
.taskbar-icon {
2434+
height: 40px;
2435+
width: 40px;
2436+
}
2437+
2438+
/* Hide scrollbar for Chrome, Safari and Opera */
2439+
.taskbar ::-webkit-scrollbar {
2440+
width: 0 !important;
2441+
display: none;
2442+
}
2443+
2444+
/* Hide scrollbar for IE, Edge and Firefox */
2445+
.taskbar {
2446+
-ms-overflow-style: none;
2447+
/* IE and Edge */
2448+
scrollbar-width: none;
2449+
/* Firefox */
2450+
}
2451+
24472452
}
24482453

24492454
/*****************************************************

0 commit comments

Comments
 (0)