Skip to content
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

UITheme #1897

Merged
merged 9 commits into from
Aug 21, 2023
Merged

UITheme #1897

merged 9 commits into from
Aug 21, 2023

Conversation

dosymep
Copy link
Member

@dosymep dosymep commented Aug 19, 2023

I have added theme support to ribbon icons. Issue #1834.
image
image

@dosymep dosymep changed the base branch from master to develop August 19, 2023 12:37
@dosymep
Copy link
Member Author

dosymep commented Aug 19, 2023

Known Issues
icons do not change automatically, you need to reload Revit, or click Reload button.

When you change theme occurs cache invalidation by change its value. Maybe this solution is hack.
image

@dosymep
Copy link
Member Author

dosymep commented Aug 19, 2023

Need to update icons?

Samples

image
image

@jmcouffin
Copy link
Contributor

This is all great.
So you are not creating .dark icons pngs on the fly.
What did you use in your sample image to create all icons?
Your hack seems acceptable IMHO

@jmcouffin
Copy link
Contributor

You can add more commits for the icons .dark if you feel like it. I will look at it tomorrow if not

@dosymep
Copy link
Member Author

dosymep commented Aug 21, 2023

i used this code to convert icons to dark mode

static void CreateDarkIcon(string source)
{
    Bitmap image = (Bitmap) Image.FromFile(source);
    
    CreateBitmap(
        image,
        Color.FromArgb(235, 235, 235),
        Path.Combine(Path.GetDirectoryName(source), Path.ChangeExtension(source, ".dark.png")));
}

static void CreateBitmap(Bitmap source, Color color, string target)
{
    Bitmap output = new(source);
    for (int x = 0; x < source.Width; x++)
    {
        for (int y = 0; y < source.Height; y++)
        {
            Color pixel = source.GetPixel(x, y);
            output.SetPixel(x, y,
                pixel.A == 0
                    ? pixel
                    : Color.FromArgb(pixel.A, color.R, color.G, color.B));
        }
    }

    output.Save(target);
}

@jmcouffin jmcouffin added 2024 Enhancement Enhancement request [class->Improved #{number}: {title}] Prioritize The issue is planned to be resolved in the next version API Change Revit API change that breaks pyRevit [class->Upgraded #{number}: {title}] Bundles Issues related to the pyRevit bundles [subsystem] labels Aug 21, 2023
@jmcouffin
Copy link
Contributor

All good @dosymep, great work!

@jmcouffin jmcouffin merged commit bb1ef22 into pyrevitlabs:develop Aug 21, 2023
@github-actions
Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23233+0830-wip

@jmcouffin
Copy link
Contributor

jmcouffin commented Aug 21, 2023

Added a Setter and docstrings to get and set methods with #1898

@github-actions
Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23233+1102-wip

@github-actions
Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23233+1605-wip

@dosymep dosymep deleted the ui_theme branch August 23, 2023 05:24
@github-actions
Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23293+0837-wip

@github-actions
Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23293+1010-wip

@github-actions
Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23293+1303-wip

@github-actions
Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23295+2104-wip

@github-actions
Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23295+2132-wip

@github-actions
Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23296+0902-wip

@github-actions
Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23299+1941-wip

@github-actions
Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23304+0918-wip

Copy link
Contributor

github-actions bot commented Nov 6, 2023

📦 New work-in-progress (wip) builds are available for 4.8.14.23310+1210-wip

Copy link
Contributor

github-actions bot commented Nov 9, 2023

📦 New work-in-progress (wip) builds are available for 4.8.14.23313+1353-wip

Copy link
Contributor

github-actions bot commented Nov 9, 2023

📦 New work-in-progress (wip) builds are available for 4.8.14.23313+1412-wip

Copy link
Contributor

github-actions bot commented Nov 9, 2023

📦 New work-in-progress (wip) builds are available for 4.8.14.23313+2035-wip

Copy link
Contributor

github-actions bot commented Nov 9, 2023

📦 New work-in-progress (wip) builds are available for 4.8.14.23313+2133-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23326+1241-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23326+2020-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23327+1037-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23328+0920-wip

Copy link
Contributor

github-actions bot commented Dec 1, 2023

📦 New work-in-progress (wip) builds are available for 4.8.14.23335+1813-wip

Copy link
Contributor

github-actions bot commented Dec 4, 2023

📦 New work-in-progress (wip) builds are available for 4.8.14.23338+0813-wip

Copy link
Contributor

github-actions bot commented Dec 6, 2023

📦 New work-in-progress (wip) builds are available for 4.8.14.23340+1759-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23346+0717-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23352+1117-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23352+1544-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23353+1120-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23353+1222-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23354+0922-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23354+1019-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.23354+1055-wip

Copy link
Contributor

📦 New work-in-progress (wip) builds are available for 4.8.14.24012+1924-wip

Copy link
Contributor

📦 New public release are available for 4.8.14.24016+1909

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Change Revit API change that breaks pyRevit [class->Upgraded #{number}: {title}] Bundles Issues related to the pyRevit bundles [subsystem] Enhancement Enhancement request [class->Improved #{number}: {title}] Prioritize The issue is planned to be resolved in the next version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants