Skip to content

Conversation

@WilliamABradley
Copy link
Contributor

@WilliamABradley WilliamABradley commented Jan 21, 2018

Issue: #1539

  • Add Dark Theme to Sample App.
  • Add Toggle to switch between Themes on the Shell.

PR Type

What kind of change does this PR introduce?

  • Sample app changes

image

image

image

image

PR Checklist

Please check if your PR fulfills the following requirements:

-Inverted Greys in Dark Theme.

-Fixed PropertyControl not adapting to Theme properly.
…rces into Theme Resources.

-Picked some viable inverse colors of Resources for the Dark Theme.
@WilliamABradley
Copy link
Contributor Author

It's a start, there are some things that need fixing, like ViewExtensions for StatusBar not accepting Theme Resources, perhaps better color choices in some areas:

Screen 1

Screen 2

Screen 3

…ementExtensions, HamburgerMenu, HeaderedItems, ListViewBase.

-Added SampleIconBacking to MoreInfoContent.
-Replaced StaticResource with ThemeResource for all the Grey Brushes.
-Added warnings about Dark Theme to PrintHelper sample and docs.
@WilliamABradley
Copy link
Contributor Author

@nmetulev take a look at my latest changes, let me know what you think.

@Odonno
Copy link
Contributor

Odonno commented Jan 24, 2018

Just one stupid question but, is the dark too dark?

@nmetulev
Copy link
Contributor

Here is the dark theme the Windows design team has created, could be helpful
UWP Toolkit dark theme.zip

@skendrot
Copy link
Contributor

skendrot commented Jan 24, 2018

We'll want to test every sample with this and see what controls should be updated

Copy link
Contributor

@skendrot skendrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update Brush-Grey-05 instead of removing it from the sample pages?

@WilliamABradley
Copy link
Contributor Author

WilliamABradley commented Jan 24, 2018

@skendrot Brush-Grey-05 was only used on about 1/6 of the samples, the rest had either ApplicationThemeBackgroundBrush or no Background at all, so I unified them, so that all samples have the same background. To change the Background, we can just change the backing in the Shell Page, so it applies to all samples. Also, I opened each sample page and made sure they looked right in Dark Theme :)

@Odonno I basically just inverted all of the current colors, the first step was just ensuring that all of the resources were ThemeResources and reacted to changes in System Theme properly. Now we can easily change the color scheme by changing the values in Themes.xaml.

@WilliamABradley
Copy link
Contributor Author

@nmetulev I had an idea, instead of depending on someone's photo for the Background, why don't we just use an Acrylic brush with a Host backdrop? That way that space is filled with the User's background and we don't have to source a photo. Of course, we could have it fall back to the photo.

This could become the background in all of the samples too.

Copy link
Contributor

@skendrot skendrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small review, not complete

OffsetX="@[OffsetX:DoubleSlider:2.0:0.0-100.0]"
OffsetY="@[OffsetY:DoubleSlider:2.0:0.0-100.0]"
Color="@[Color:Brush:Black]"
Color="@[Color:Brush:Aqua]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very weird on the light theme

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a color that works in both Dark and Light Themes, the user can change it themselves.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could replace the Binding with a ThemeResource?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to allow for theme resources in the template constructor? If we grab from application resources vs. page resources, it should be easier.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the black actuly looks good on dark theme

Margin="20">
<Polyline Points="0,0 50,50 50,0 0,50"
Stroke="Black" StrokeThickness="2"/>
Stroke="Black" StrokeThickness="2" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why so many unneeded changes like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeMaid's Auto Cleanup.

@Vijay-Nirmal
Copy link
Contributor

Widgets or light-weight apps can reinforce their usage as utility apps by drawing acrylic edge-to-edge inside their app window.

Rendering acrylic surfaces is GPU intensive, which can increase device power consumption and shorten battery life.

Souce Acrylic material

@WilliamABradley So the question is, is this a light-weight app to use the background acrylic?

We can use background acrylic in Horizontal Tabs and in-app acrylic in extended horizontal tabs.

applicationframehost_2018-01-25_10-17-13

@WilliamABradley
Copy link
Contributor Author

Nvm about background replacement, Acrylic overload!

Acrylic overload

That's better, some design adherence!

Design Adherence

…ictionary, to maintain support for older versions of Windows 10.

-Styled About Page according to recommended designs.

-Fixed Titlebar in Dark Theme.
@Odonno
Copy link
Contributor

Odonno commented Jan 25, 2018

Well. Start to look really nice.

…new SampleController Page.

-SampleController uses Activator to create the Sample pages instead of a Frame, therefore, all navigating and navigated overrides had to to be replaced with local calls.

-Samples without Pages (Documentation only) will now actually Navigate properly and show their docs, although there will be a void on the left side of the page currently.
@WilliamABradley
Copy link
Contributor Author

I carefully ripped out all Sample Logic from the Shell Page, and added it to a new page called SampleController, as this logic should be handled separately.

This allows the Shell to be easily modified separately from the SampleController and vice versa.

Other benefits include:

  • Any interactions with the Sample can be cached and restored.
  • The UI is easier to edit (Like VisualStateManager).
  • Samples without Sample Pages (Documentation only) will now work.
  • It is cleaner and easier to understand what is going on in the code.

-Fixed SampleController Xaml Designer visibility.

-Applied Background to Info Area uniformly (Transparent PropertiesControl and MarkdownTextBlock).

-Broke several Visual States and functions in SampleController.
@WilliamABradley
Copy link
Contributor Author

WilliamABradley commented Jul 1, 2018

@nmetulev @michael-hawker Sorry I have been pretty busy lately.
I have moved the Expander button inline into the Pivot Left Header, you are welcome to try out the flow there. I'm not sure how the style should be when the Pane is expanded, so I moved it under the Title bar, like in Narrow View.

Desktop Narrow Desktop Full
image image
Slim Sample Slim Properties
image image

@nmetulev
Copy link
Contributor

nmetulev commented Jul 9, 2018

Thanks @WilliamABradley. This looks great. Just few more minor details:

  • theme changes should only affect sample, not app
  • need to add theme setting in landing page
  • sample header and properties panel have same background in light theme, header should be darker (similar to dark theme)
  • limit drag of properties pane to a certain width
  • expander button should be a bit lower. In narrow view it should not be the i icon but the open pane icon

@nmetulev nmetulev modified the milestones: 3.1, 4.0 Jul 11, 2018
@@ -0,0 +1,13 @@
## Google analytics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc page was removed a while ago, should still be removed

"DocumentationUrl": "https://raw.githubusercontent.com/Microsoft/WindowsCommunityToolkit/master/docs/developer-tools/FocusTracker.md"
},
{
"Name": "Analytics",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove this sample, it should have been removed a while ago?

@nmetulev
Copy link
Contributor

Please make sure only the sample changes the theme and not the properties pane. Otherwise, looks good

@WilliamABradley
Copy link
Contributor Author

@nmetulev Changes have been made.

@nmetulev
Copy link
Contributor

nmetulev commented Aug 1, 2018

Thanks @WilliamABradley. I noticed the Shell buttons don't have a background after the latest changes, otherwise, looks good.

image

@nmetulev nmetulev merged commit 7873f88 into CommunityToolkit:master Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants