private void setupTaskbar() { AppGrabber.Category quickLaunch = appGrabber.QuickLaunch; this.quickLaunchList.ItemsSource = quickLaunch; this.bdrTaskbar.MaxWidth = AppBarHelper.PrimaryMonitorSize.Width - 36; this.Width = AppBarHelper.PrimaryMonitorSize.Width; // set taskbar edge based on preference if (Settings.TaskbarPosition == 1) { this.Top = Startup.MenuBarWindow.Height; appBarEdge = AppBarHelper.ABEdge.ABE_TOP; bdrTaskbar.Style = Application.Current.FindResource("CairoTaskbarTopBorderStyle") as Style; bdrTaskbarEnd.Style = Application.Current.FindResource("CairoTaskbarEndTopBorderStyle") as Style; bdrTaskListPopup.Style = Application.Current.FindResource("CairoTaskListTopPopupStyle") as Style; btnTaskList.Style = Application.Current.FindResource("CairoTaskbarTopButtonList") as Style; TasksList.Margin = new Thickness(0); } else { int screen = AppBarHelper.PrimaryMonitorSize.Height; setTopPosition(screen, true); } // show task view on windows >= 10, adjust margin if not shown if (Shell.IsWindows10OrBetter && !Startup.IsCairoUserShell) { bdrTaskView.Visibility = Visibility.Visible; } else { TasksList2.Margin = new Thickness(0, -3, 0, -3); } }
private void setupTaskbarAppearance() { double screenWidth = screenWidth = Screen.Bounds.Width / dpiScale; Left = Screen.Bounds.Left / dpiScale; bdrTaskbar.MaxWidth = screenWidth - 36; Width = screenWidth; switch (Settings.TaskbarIconSize) { case 0: addToSize = 16; break; case 10: addToSize = 8; break; default: addToSize = 0; break; } Height = 29 + addToSize; // set taskbar edge based on preference if (Settings.TaskbarPosition == 1) { Top = Startup.MenuBarWindow.Height; appBarEdge = AppBarHelper.ABEdge.ABE_TOP; bdrTaskbar.Style = Application.Current.FindResource("CairoTaskbarTopBorderStyle") as Style; bdrTaskbarEnd.Style = Application.Current.FindResource("CairoTaskbarEndTopBorderStyle") as Style; bdrTaskbarLeft.Style = Application.Current.FindResource("CairoTaskbarLeftTopBorderStyle") as Style; btnTaskList.Style = Application.Current.FindResource("CairoTaskbarTopButtonList") as Style; btnDesktopOverlay.Style = Application.Current.FindResource("CairoTaskbarTopButtonDesktopOverlay") as Style; TaskbarGroupStyle.ContainerStyle = Application.Current.FindResource("CairoTaskbarTopGroupStyle") as Style; TasksList.Margin = new Thickness(0); bdrTaskListPopup.Margin = new Thickness(5, Top + Height - 1, 5, 11); } else { bdrTaskListPopup.Margin = new Thickness(5, 0, 5, Height - 1); setTopPosition(Screen.Bounds.Bottom / dpiScale); } // show task view on windows >= 10, adjust margin if not shown if (Shell.IsWindows10OrBetter && !Startup.IsCairoUserShell) { bdrTaskView.Visibility = Visibility.Visible; } else { TasksList2.Margin = new Thickness(0, -3, 0, -3); } if (Settings.FullWidthTaskBar) { bdrTaskbarLeft.CornerRadius = new CornerRadius(0); bdrTaskbarEnd.CornerRadius = new CornerRadius(0); } }
private void setupTaskbar() { double screenWidth = screenWidth = Screen.Bounds.Width / dpiScale; Left = Screen.Bounds.Left / dpiScale; this.DataContext = WindowsTasks.WindowsTasksService.Instance; bdrMain.DataContext = Settings.Instance; grdTaskbar.DataContext = WindowsTasks.WindowsTasksService.Instance; AppGrabber.Category quickLaunch = appGrabber.QuickLaunch; this.quickLaunchList.ItemsSource = quickLaunch; this.bdrTaskbar.MaxWidth = screenWidth - 36; this.Width = screenWidth; switch (Settings.TaskbarIconSize) { case 0: addToSize = 16; break; case 10: addToSize = 8; break; default: addToSize = 0; break; } this.Height = 29 + addToSize; ((INotifyCollectionChanged)TasksList.Items).CollectionChanged += TasksList_Changed; if (Startup.DesktopWindow != null) { btnDesktopOverlay.DataContext = Startup.DesktopWindow; } else { btnDesktopOverlay.Visibility = Visibility.Collapsed; } // set taskbar edge based on preference if (Settings.TaskbarPosition == 1) { this.Top = Startup.MenuBarWindow.Height; appBarEdge = AppBarHelper.ABEdge.ABE_TOP; bdrTaskbar.Style = Application.Current.FindResource("CairoTaskbarTopBorderStyle") as Style; bdrTaskbarEnd.Style = Application.Current.FindResource("CairoTaskbarEndTopBorderStyle") as Style; bdrTaskbarLeft.Style = Application.Current.FindResource("CairoTaskbarLeftTopBorderStyle") as Style; btnTaskList.Style = Application.Current.FindResource("CairoTaskbarTopButtonList") as Style; btnDesktopOverlay.Style = Application.Current.FindResource("CairoTaskbarTopButtonDesktopOverlay") as Style; TaskbarGroupStyle.ContainerStyle = Application.Current.FindResource("CairoTaskbarTopGroupStyle") as Style; TasksList.Margin = new Thickness(0); bdrTaskListPopup.Margin = new Thickness(5, this.Top + this.Height - 1, 5, 11); } else { bdrTaskListPopup.Margin = new Thickness(5, 0, 5, this.Height - 1); setTopPosition(Screen.Bounds.Bottom / dpiScale); } // show task view on windows >= 10, adjust margin if not shown if (Shell.IsWindows10OrBetter && !Startup.IsCairoUserShell) { bdrTaskView.Visibility = Visibility.Visible; } else { TasksList2.Margin = new Thickness(0, -3, 0, -3); } }