Comments (31)
Needs research.
from budoco.
Have you worked with electron before? I just started this week.
from budoco.
I'll start in a few minutes... 😄
from budoco.
@ivangrek - I have one more issue that I want to do , autoreplies to emails, and then I'm going to stop working on Budoco unless there are some actual people who are using it. If you want to keep working on it, then you should fork it, and then enjoy doing things YOUR way, with EF, etc.
The other open issues, they can all wait, or maybe I'll do them when I have trouble sleeping, but if somebody wants to use Budoco, those open issues aren't going to stop them. I wonder if anybody ever will use Budoco???
I'm going to focus on the screenshot tool also because I want to learn electron, and also because my son is starting a business that might involve electron.
If you want to keep in touch, I'm at [email protected].
from budoco.
Ok. Will help.
main.js
const { app, BrowserWindow } = require('electron')
function createWindow () {
const win = new BrowserWindow({
frame: false,
fullScreen: true,
transparent: true,
webPreferences: {
nodeIntegration: true
}
})
win.loadFile('index.html')
win.setFullScreen(true);
}
app.whenReady().then(createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
index.html
<!DOCTYPE html>
<html>
<head style="min-width: 100vw; min-height: vh;">
<meta charset="utf-8">
<title>Electron App</title>
</head>
<body style="min-width: 100vw; min-height: vh;">
<div id="h-rule" style="height: 0; border-top: 1px dashed red; position: fixed; top: 0; left: 0; right: 0;"></div>
<div id="v-rule" style="width: 0; border-left: 1px dashed red; position: fixed; top: 0; bottom: 0; left: 0;"></div>
<div id="region" style="display: none; width: 0; border: 1px dashed red; position: fixed; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script>
const hRule = document.getElementById("h-rule");
const vRule = document.getElementById("v-rule");
const region = document.getElementById("region");
var selection = false;
var startPoint;
var endPoint;
document.addEventListener("mousemove", (e) => {
hRule.style.top = `${e.pageY}px`;
vRule.style.left = `${e.pageX}px`;
if(selection) {
endPoint = {
pageX: e.pageX,
pageY: e.pageY
};
if(endPoint.pageX - startPoint.pageX < 0) {
[startPoint.pageX, endPoint.pageX] = [endPoint.pageX, startPoint.pageX];
}
if(endPoint.pageY - startPoint.pageY < 0) {
[startPoint.pageY, endPoint.pageY] = [endPoint.pageY, startPoint.pageY];
}
region.style.top = `${startPoint.pageY}px`;
region.style.left = `${startPoint.pageX}px`;
region.style.width = `${endPoint.pageX - startPoint.pageX}px`;
region.style.height = `${endPoint.pageY - startPoint.pageY}px`;
}
});
document.addEventListener("mousedown", (e) => {
e.preventDefault();
selection = true;
startPoint = {
pageX: e.pageX,
pageY: e.pageY
};
region.style.display = "block";
});
document.addEventListener("mouseup", (e) => {
e.preventDefault();
selection = false;
region.style.display = "none";
});
</script>
</body>
</html>
Good luck!
from budoco.
Your such a fast learner!!
from budoco.
Isn't transparent on my machine Mint 20, based on Ubuntu 20. The behavior of Electron windows is definitely different on different platforms.
from budoco.
https://stackoverflow.com/questions/54763647/transparent-windows-on-linux-electron
from budoco.
Add this worked:
app.commandLine.appendSwitch('enable-transparent-visuals');
app.commandLine.appendSwitch('disable-gpu');
from budoco.
You can also run the index.html file in browser.
from budoco.
@ivangrek
It's ugly, but the technology works end to end:
https://github.com/ctrager/budoco_screenshot
Thanks for your help with the transparent window. I still have a lot of work to do, but I don't have any research to do.
from budoco.
I can't select a region on the Windows now.
from budoco.
Works for me, but I see discussions about different behavior on different OSs.
https://drive.google.com/file/d/1OI8GXfTyTgrzwz2U4rNuKHH04UZSsn3G/view?usp=sharing
from budoco.
Works super!
from budoco.
@ivangrek - I'm confused. Did you have to make code changes to make it work for you?
from budoco.
and, just curious, where do you live?
from budoco.
@ivangrek - I'm confused. Did you have to make code changes to make it work for you?
I am doing some changes and testing how it works.
from budoco.
You didn't anwer my question - Did you have ot make code changes to make it work for you?
from budoco.
Did you have ot make code changes to make it work for you?
I don't think I understand the question. I made such changes and it worked for me.
transparent.html
<head style="min-width: 100vw; min-height: vh;"> to <html>
<body style="min-width: 100vw; min-height: vh;"> to <body style="background-color: rgba(0, 0, 0, 0.01);">
background-color: rgba(0, 0, 0, 0.01);
Displays the transparent layer. Without this, the layer does not appear at all.
from budoco.
What's your OS?
from budoco.
What's your OS?
Windows 10.
from budoco.
If you close the transparent window, then the main thing will not appear, and the process will not end.
from budoco.
from budoco.
@ivangrek - Can you get the latest and tell me if it works okay on your Windows 10?
from budoco.
Works!
Except electron/electron#21538.
I think can turn off window resizing to prevent this case.
transparent_win.loadFile('transparent.html')
transparent_win.setFullScreen(true);
transparent_win.setResizable(false);
from budoco.
I put in your change. I couldn't reproduce your bug, but still I put in your change. Also, now you can draw on the screenshot, for example to circle things, before you send it. I think it's done.
from budoco.
The brush sometimes does not reset and starts drawing immediately without pressing, if you make several pictures in a row.
from budoco.
I created an issue for this in the budoco_screenshot repo. Do you want to work on it?
from budoco.
Try select "Capture" and close transparent window. I do it with Alt + F4.
Main window not showing and process still running.
from budoco.
I created an issue for this in the budoco_screenshot repo. Do you want to work on it?
Ok. I will fix it.
from budoco.
If the user has to hit Alt + F4 to CAUSE this bug, I don't want to fix it.
from budoco.
Related Issues (20)
- Fix posts N+1 HOT 1
- Cache dropdown contents until admin makes them dirty (custom, org, for example) HOT 29
- History posts - "status was changed from foo to bar by somebody on date" HOT 1
- Let incoming emails create issues, not just posts to issues. HOT 1
- reorganize sql scripts. clearly define the prod ones from the demo ones. HOT 1
- Issues, history posts, for changes to description and details, something better than [hover to view] HOT 20
- Incoming email post, "Reply".
- create "migration" scheme HOT 1
- Add side-by-side diff showing in "Before and After" modal.
- Auto reply to emails that create new issues
- For incoming emails, enhance the org with email domain that can be used for org assignment
- Admin, Pending Users, "Update" link goes to non-existent page.
- I don't know how to allow a post from a "foreign" source (for posting screenshots from separate app) HOT 5
- column "rp_desc" does not exist HOT 1
- IIS hosting is not working in windows 10 HOT 2
- [Feature request] Migration from BugTracker.Net to Budoco ? HOT 2
- Can not skip registration page as admin HOT 9
- Wrong search URL HOT 1
- Requesting for installation instructions on Mac OS (Sonoma)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from budoco.