Giter VIP home page Giter VIP logo

Comments (9)

GeneralBombe avatar GeneralBombe commented on May 29, 2024 1

Try fill like this:

        let panel_frame = egui::Frame {
            fill: egui::Color32::TRANSPARENT,
            ..Default::default()
        };

OR

        let panel_frame = egui::Frame {
            fill: egui::Color32::from_rgba_premultiplied(0, 0, 0, 50),
            ..Default::default()
        };

Hmmm, still does not work. Also i somehow don't get a windowed window, only fullscreen.
Do you have a idea what the issue is?
I tried it with this:

fn main() -> eframe::Result<()> {
    env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).

    let native_options = eframe::NativeOptions {
        viewport: egui::ViewportBuilder::default()
            .with_transparent(true) // Make the window transparent
            .with_decorations(false)
            .with_max_inner_size([200.0, 200.0])
            .with_min_inner_size([100.0,100.0]),
        ..Default::default()
    };

    eframe::run_native(
        "esp",
        native_options,
        Box::new(|cc| Box::new(RustEsp::TemplateApp::new(cc).unwrap())),
    )
}

I am really confused right now.

from egui.

GeneralBombe avatar GeneralBombe commented on May 29, 2024 1

@rustbasic thank you for now, ill try it later :)

from egui.

GeneralBombe avatar GeneralBombe commented on May 29, 2024 1

@GeneralBombe

I tested your source code. Temporarily use below. For the remaining functions, try using ViewportCommand.

    let native_options = eframe::NativeOptions {
        viewport: egui::ViewportBuilder::default()
            // .with_fullscreen(true)
            .with_inner_size(egui::vec2(800.0, 600.0))
            // .with_decorations(false)
            .with_transparent(true), // Make the window transparent
        ..Default::default()
    };

Hello, yes this works :). But i am still really really really confused. The window is only Transparent if it opens my 2nd monitor (it does not matter if it is set as the main or secondary monitor). Same thing if i try to open the window with glfw ...
Wtf?

from egui.

GeneralBombe avatar GeneralBombe commented on May 29, 2024 1

So i think this issue is not about egui/eframe/glfw but about windows? Really annoying ... I can drag the window to the other monitor and the transparency works ...

from egui.

rustbasic avatar rustbasic commented on May 29, 2024

Try fill like this:

        let panel_frame = egui::Frame {
            fill: egui::Color32::TRANSPARENT,
            ..Default::default()
        };

OR

        let panel_frame = egui::Frame {
            fill: egui::Color32::from_rgba_premultiplied(0, 0, 0, 50),
            ..Default::default()
        };

from egui.

rustbasic avatar rustbasic commented on May 29, 2024

You ask a question, but I don't even know what an your OS is. may be Linux.
There seems to be no problem with Windows 10.
Please find a solution in the form below.

            if ui.button("transparent").clicked() {                                   
                ui.ctx()                                                              
                    .send_viewport_cmd(egui::ViewportCommand::Transparent(false));    
            }                                                                         
                                                                                      
            if ui.button("innersize").clicked() {                                     
                ui.ctx()                                                              
                    .send_viewport_cmd(egui::ViewportCommand::InnerSize(egui::Vec2::new(500.0, 500.0)));
            }                                                                         

from egui.

rustbasic avatar rustbasic commented on May 29, 2024

@GeneralBombe

I tested your source code.
Temporarily use below.
For the remaining functions, try using ViewportCommand.

    let native_options = eframe::NativeOptions {
        viewport: egui::ViewportBuilder::default()
            // .with_fullscreen(true)
            .with_inner_size(egui::vec2(800.0, 600.0))
            // .with_decorations(false)
            .with_transparent(true), // Make the window transparent
        ..Default::default()
    };

from egui.

GeneralBombe avatar GeneralBombe commented on May 29, 2024

@rustbasic i got a github email with your quote "Could you please apply the Pull Request below and see if it works as desired, and let me know the results?". I tried to add the branch as dependencie, got this error when i tried to cargo run:
error: failed to select a version for objc-sys. ... required by package objc2 v0.4.1... which satisfies dependencyobjc2 = "^0.4.1"(locked to 0.4.1) of packageglutin v0.31.2... which satisfies dependencyglutin = "^0.31"(locked to 0.31.2) of packageeframe v0.27.2 (https://github.com/rustbasic/egui.git?branch=patch52#267fb5ac)`
... which satisfies git dependency eframe of package eframe_template v0.1.0 (F:\Programming\egui-eframe-playground)
versions that meet the requirements ^0.3.1 (locked to 0.3.2) are: 0.3.2

the package objc-sys links to the native library objc_0_3, but it conflicts with a previous package which links to objc_0_3 as well:
package objc-sys v0.3.3
... which satisfies dependency objc-sys = "^0.3.3" of package objc2 v0.5.1
... which satisfies dependency objc2 = "^0.5.1" of package block2 v0.5.0
... which satisfies dependency block2 = "^0.5.0" of package objc2-app-kit v0.2.0
... which satisfies dependency objc2-app-kit = "^0.2.0" of package eframe v0.27.2 (https://github.com/rustbasic/egui.git?branch=patch52#267fb5ac)
... which satisfies git dependency eframe of package eframe_template v0.1.0 (F:\Programming\egui-eframe-playground)
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the links ='objc-sys' value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.
Did i add it correctly as dependencie? eframe = { version = "0.27.0", default-features = false, features = [
"accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies.
"default_fonts", # Embed the default egui fonts.
"glow", # Use the glow rendering backend. Alternative: "wgpu".
"persistence", # Enable restoring app state when restarting the app.
], git = "https://github.com/rustbasic/egui.git", branch = "patch52"}`

from egui.

rustbasic avatar rustbasic commented on May 29, 2024

I closed it because I didn't think it could be resolved this way.
Use ViewportCommand to implement the functionality you want as much as possible.

from egui.

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.