Exemple #1
0
        public static void ScaleDpi(this TabHeaderControl tab, Func <Bitmap, Bitmap> transformIcon)
        {
            _scaler.Setup(tab);
            tab.ScaleDpiFont();

            var iconsScaler = DpiScalers.Combine(
                new DpiScaler <TabHeaderControl, Bitmap>(
                    c => c.CloseIcon,
                    (c, bmp) => c.CloseIcon = bmp,
                    transformIcon),
                new DpiScaler <TabHeaderControl, Bitmap>(
                    c => c.CloseIconHovered,
                    (c, bmp) => c.CloseIconHovered = bmp,
                    transformIcon),
                new DpiScaler <TabHeaderControl, Bitmap>(
                    c => c.AddIcon,
                    (c, bmp) => c.AddIcon = bmp,
                    transformIcon),
                new DpiScaler <TabHeaderControl, Bitmap>(
                    c => c.DefaultIcon,
                    (c, bmp) => c.DefaultIcon = bmp,
                    transformIcon));

            iconsScaler.Setup(tab);

            _textWidthScaler.Setup(tab);
        }
Exemple #2
0
        public void ScaleDpi()
        {
            _tooltipTextbox.ScaleDpiFont();

            new DpiScaler <TooltipForm>(form => form.setupIcons())
            .Setup(this);

            DpiScalers.Combine(
                new DpiScaler <TooltipForm, int>(
                    f => f.TooltipMargin,
                    (f, m) => f.TooltipMargin = m,
                    m => m.ByDpiWidth()
                    ),
                new DpiScaler <TooltipForm, Size>(
                    f => f.MonoLineInterval,
                    (f, m) => f.MonoLineInterval = m,
                    m => m.ByDpi()
                    ),
                new DpiScaler <TooltipForm, Padding>(
                    f => f.TextPadding,
                    (f, p) => f.TextPadding = p,
                    p => p.ByDpi()
                    )
                ).Setup(this);
        }
 createViewOptionsScaler(Func <Bitmap, Bitmap> transformIcons)
 {
     return(DpiScalers.Combine(
                DpiScalers.Combine(
                    new DpiScaler <LayoutViewControl, Dictionary <Direction, Bitmap> >(
                        c => c.LayoutOptions.AlignmentIconsByDirection.ToDictionary(),
                        (c, d) => c.LayoutOptions.AlignmentIconsByDirection = d,
                        d => d.ToDictionary(_ => _.Key, _ => _.Value?.Invoke0(transformIcons))
                        ),
                    new DpiScaler <LayoutViewControl, Dictionary <Direction, Bitmap> >(
                        c => c.LayoutOptions.AlignmentHoveredIconsByDirection.ToDictionary(),
                        (c, d) => c.LayoutOptions.AlignmentHoveredIconsByDirection = d,
                        d => d.ToDictionary(_ => _.Key, _ => _.Value?.Invoke0(transformIcons))
                        )),
                DpiScalers.Combine(
                    new DpiScaler <LayoutViewControl, Bitmap>(
                        c => c.SortOptions.Icon,
                        (c, bmp) => c.SortOptions.Icon = bmp,
                        bmp => bmp?.Invoke0(transformIcons)),
                    new DpiScaler <LayoutViewControl, Bitmap>(
                        c => c.SortOptions.AscIcon,
                        (c, bmp) => c.SortOptions.AscIcon = bmp,
                        bmp => bmp?.Invoke0(transformIcons)),
                    new DpiScaler <LayoutViewControl, Bitmap>(
                        c => c.SortOptions.DescIcon,
                        (c, bmp) => c.SortOptions.DescIcon = bmp,
                        bmp => bmp?.Invoke0(transformIcons))
                    ),
                DpiScalers.Combine(
                    new DpiScaler <LayoutViewControl, Bitmap>(
                        c => c.SortOptions.IconTransp,
                        (c, bmp) => c.SortOptions.IconTransp = bmp,
                        bmp => bmp?.Invoke0(transformIcons)),
                    new DpiScaler <LayoutViewControl, Bitmap>(
                        c => c.SortOptions.AscIconTransp,
                        (c, bmp) => c.SortOptions.AscIconTransp = bmp,
                        bmp => bmp?.Invoke0(transformIcons)),
                    new DpiScaler <LayoutViewControl, Bitmap>(
                        c => c.SortOptions.DescIconTransp,
                        (c, bmp) => c.SortOptions.DescIconTransp = bmp,
                        bmp => bmp?.Invoke0(transformIcons))),
                DpiScalers.Combine(
                    new DpiScaler <LayoutViewControl, Bitmap>(
                        c => c.SearchOptions.Button.Icon,
                        (c, bmp) => c.SearchOptions.Button.Icon = bmp,
                        bmp => bmp?.Invoke0(transformIcons)),
                    new DpiScaler <LayoutViewControl, Bitmap>(
                        c => c.SearchOptions.Button.IconTransp,
                        (c, bmp) => c.SearchOptions.Button.IconTransp = bmp,
                        bmp => bmp?.Invoke0(transformIcons))
                    )
                ));
 }