Giter VIP home page Giter VIP logo

Comments (6)

dbuechel avatar dbuechel commented on June 16, 2024

This isn't possible due to a restriction in the browser engine. Zooming via the browser menu or keyboard shortcuts should however work as expected. The option is still there for users who have SEB 2.x and 3.x in usage.

from seb-win-refactoring.

jp-weber avatar jp-weber commented on June 16, 2024

@dbuechel Oh well, thanks, I didn't know that. But maybe we could solve this in the meantime as a workaround, where the browser window recognizes ctrl + mouse wheel and then executes the logic behind the zoom in/out button?

PreviewMouseWheel += Window_ZoomMouseWheel;

private void Window_ZoomMouseWheel(object sender, MouseWheelEventArgs e)
{
    if (Keyboard.Modifiers == ModifierKeys.Control)
    {
       if (e.Delta > 0)
          ZoomInRequested?.Invoke();

       else if (e.Delta < 0)
          ZoomOutRequested?.Invoke();
    }
}

from seb-win-refactoring.

dbuechel avatar dbuechel commented on June 16, 2024

This unfortunately doesn't work, as the browser engine is embedding its own window structure within the browser window. The event handler you're using will only catch events which are anywhere over the window except the browser control (i.e. browser content) itself.

from seb-win-refactoring.

danschlet avatar danschlet commented on June 16, 2024

I honestly wonder why you would like to use ctrl + mouse wheel for zooming web pages. That sounds like a very non-standard, outdated way (I think besides old Windows Firefox versions and therefore SEB 2.x, no other browser supports that, mostly they would use keyboard shortcuts, or am I wrong?).

from seb-win-refactoring.

jp-weber avatar jp-weber commented on June 16, 2024

It is difficult to see how the browser control is embedded. But as I have seen, there are functions and solutions for zooming from the browser control, also for the mouse wheel.
https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Wpf/ChromiumWebBrowser.cs#L262
https://stackoverflow.com/a/39220412

@danschlet some students have complained to us that their normal way of zooming no longer works. But for me this is also a normal way to zoom, which to my knowledge works in all browsers (e.g. Edge Chromium) and other applications.

from seb-win-refactoring.

dbuechel avatar dbuechel commented on June 16, 2024

Yes, that is correct, CTRL+mouse wheel is a standard way to zoom (at least on Windows). But we're using the Windows Forms version of the CefSharp browser control and the last time I checked, it unfortunately wasn't possible to implement zooming via CTRL+mouse wheel for it. If you have news that this changed, please point me to them and I'll of course implement the functionality for an upcoming version.

from seb-win-refactoring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.