New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WS10 Add support for new themes format #273
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like you've had to do more work than you should need to (I wonder how dock icons would react with a light/dark switch) as they can't be updated. Can you take me through it tomorrow?
export async function updateBrowserWindowButtonsColorScheme( | ||
browserWindow: BrowserWindowModule | ||
): Promise<void> { | ||
const options = await browserWindow.openfinWindow.getOptions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like it should be part of the button definition with v10 sdk. i.e. provide two sets of icons and the workspace code does this work. We can catch up tomorrow on whether we should propose it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the syntax in the definition, you dont need to declare a separate themes section, just use {theme}
in the path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does that break backwards compatibility? Do we need to make a note of that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add to changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm this might break sales studio as well so we might need v10 logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see anything themed icon paths in Sales Studio
options: OpenFin.PlatformWindowCreationOptions, | ||
identity?: OpenFin.Identity | ||
): Promise<OpenFin.Window> { | ||
const window = await super.createWindow(options, identity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this get triggered by classic windows?
export async function updateBrowserWindowButtonsColorScheme( | ||
browserWindow: BrowserWindowModule | ||
): Promise<void> { | ||
const options = await browserWindow.openfinWindow.getOptions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does that break backwards compatibility? Do we need to make a note of that?
|
||
public async setSelectedScheme(schemeType: ColorSchemeOptionType) { | ||
// The color scheme has been updated, so update the theme | ||
await setCurrentColorSchemeMode(schemeType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than adding more and more logic here over time...could we not update the theme.ts via setCurrentColorScheme and that triggers a lifecycle event of theme changed? That way dock, and browser could register an action against that lifecycle event and if a platform dev wanted to hook into they could define a module and register it against the event as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we could certainly do it that way as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that way if we have a custom button it just cares about telling theme.ts to switch and the lifecycle event will trigger everything else (rather than all the logic being in the override).
export async function getWindowState(): Promise<"normal" | "minimized" | "none"> { | ||
if (registrationInfo) { | ||
try { | ||
const win = fin.Window.wrapSync({ name: "openfin-dock", uuid: "openfin-browser" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be doing this. It was done in the past when there was no sdk but we shouldn't be dependant on uuid (it can change) and dock name. This should be a feature request for the api to expose state (e.g. isVisible)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
WIP - waiting for WS bugfixes