When my electron app starts after every restart not maximize while I set alwaysOnTop to be true and minimizable to be false.
I creating mainWindow like below:
var scl = 1;
mainWindow = new BrowserWindow(
{
screen: electron.screen.getAllDisplays()[2],
x:1920,
width: 1080*scl,
height: 1920*scl,
fullscreen:true,
minimizable:false,
resizable:false,
closable:false,
alwaysOnTop:true,
maximize:true
});
I also added it to shell:startup but when application starts up it remains minimize.
OS: Windows 10 Home 64
electron version:1.4.8
electron-builder: ^8.6.0
electron-prebuilt: ^1.4.8
Any Idea?
You should check your x value given during your BrowserWindow initialization. This value describes the offset from the upper left corner to the right, it is likely that your window is not minimized but instead pushed off the screen.
Related
I am trying to find out why flicking is not working with a TreeView example on my Raspberry Pi3 with touch screen.
Looking at the qml code of TreeView.qml, e.g.
https://github.com/RSATom/Qt/blob/master/qtquickcontrols/src/controls/TreeView.qml:
BasicTableView {
...
__mouseArea: MouseArea {
id: mouseArea
parent: __listView
width: __listView.width
height: __listView.height
z: -1
propagateComposedEvents: true
focus: true
// If there is not a touchscreen, keep the flickable from eating our mouse drags.
// If there is a touchscreen, flicking is possible, but selection can be done only by tapping, not by dragging.
preventStealing: !Settings.hasTouchScreen
...
}
}
By similarly looking at the qml code for BasicTableView.qml, it seems that behavior is controlled by Settings.hasTouchScreen.
According to:
https://code.woboq.org/qt5/qtquickcontrols/src/controls/Private/qquickcontrolsettings.cpp.html
it corresponds to the following method:
bool QQuickControlSettings1::hasTouchScreen() const
{
const auto devices = QTouchDevice::devices();
for (const QTouchDevice *dev : devices)
if (dev->type() == QTouchDevice::TouchScreen)
return true;
return false;
}
However, in my case, Settings.hasTouchScreen returns false; i.e. the touch screen (although working for the rest), is not
correctly detected by the QML environment, which probably explains why the flicking does not work.
According to https://doc.qt.io/qt-5/qtouchdevice.html, my touch device should have been registered somehow by the private QWindowSystemInterface::registerTouchDevice() method, but wasn't.
How can I get this to work?
Thanks!
It seems not to work correctly with tslib, but works by using the evdevtouch plugin which is enabled by adding the following command line arguments when launching the program:
-plugin evdevtouch:/dev/input/eventX
where eventX is the event assigned to the touch input.
With that, QTouchDevice::devices() is no longer empty, and the flicking of the TreeView works.
I want to fade out the splash screen.
I think it's possible in native code android or iOS.
However for titanium which way is the appropriate ??
for now my source code is this
var topWin = Ti.UI.createWindow();// main application window.
var img = Ti.UI.createImageView({
image : '/img/Default.png',
top : 0,
left : 0,
width : '100%',
height : '100%'
});
var splash = Ti.UI.createWindow(); //splash window
splash.add(img);
splash.open();
var fadeOut = Ti.UI.createAnimation({
opacity : 0.2,
duration : 300
});
var fadeIn = Ti.UI.createAnimation({
opacity : 1,
duration : 1800
});
setTimeout(function(e) {
splash.close(fadeOut);
topWin.open(fadeIn);
}, 3000);
It works as I mean however I think this way might be a bit strange.
Since
I have to decide the each image according to different resolution devices(iphone/ipad/android ,,) by manual while splash screen is chosen automatically.
Is there a good way other than this??
Take a look at this:
http://www.tidev.io/2015/01/06/how-to-re-use-the-launch-image-in-the-app/
I haven't done this in a while, and I'm not sure if the changes to 5.2 SDK for iOS for Storyboard launch files breaks this method but here's where I'd start.
I'm very noob in Titanium Mobile.
When I create a new window the content of it goes through the iPhone Status bar (hour, signal and battery icons go on the content of my window).
Is there a fast way to check if the App is run by an iPhone and set the window to start under the status bar? (I mean in alloy way).
"#mainWindow": {
fullscreen: false,
statusBarStyle:Titanium.UI.iPhone.StatusBar.DEFAULT
}
I tried this but it did not work, but if I set in the previous code the property fullscreen to true the status bar disappears.
I suppose you want use this app at iOS 7 (title question).
"#mainWindow": {
fullscreen: false,
statusBarStyle: Ti.UI.iPhone.StatusBar.DEFAULT
width: Ti.Platform.DisplayCaps.getPlatformWidth(),
height: (Ti.Platform.DisplayCaps.getDpi() === 320 || Ti.Platform.DisplayCaps.getDpi() === 260) ? Ti.Platform.DisplayCaps.getPlatformHeight() - 40 : Ti.Platform.DisplayCaps.getPlatformHeight() - 20,
top: (Ti.Platform.DisplayCaps.getDpi() === 320 || Ti.Platform.DisplayCaps.getDpi() === 260) ? 40 : 20
}
The MainWindow Top or View where you add all UI Elements must have top 40 (retina) or 20.
This is the height of StatusBar on iOS. If you want use this app at iOS version below 7.0, top is 0.
Is there any way to take a screenshot on Windows Phone 8 (or 7.1) programmatically?
For Windows Phone 7/7.1, there is at least an inofficial solution:
http://forum.xda-developers.com/showthread.php?t=1006331
But I have no idea what to do to get this functionality in my own app.
Also, I would intend to take screenshots not only of my own app but also of other apps (e.g. timer triggered).
you can take the screen shot in your windows phone 8, by the simultaneous press of the volume button and the window key. or else try this code
var bmp = new WriteableBitmap(lbxDays, new TranslateTransform());
var width = (int)bmp.PixelWidth;
var height = (int)bmp.PixelHeight;
bmp.Render(lbxDays, new TranslateTransform());
using (var ms = new MemoryStream())
{
bmp.SaveJpeg(ms, width, height, 0, 100);
ms.Seek(0, System.IO.SeekOrigin.Begin);
var lib = new MediaLibrary();
var dateStr = DateTime.Now.Ticks;
var picture = lib.SavePicture(string.Format("screenshot"+dateStr+".jpg"), ms);
var task = new ShareMediaTask();
task.FilePath = picture.GetPath();
task.Show();
}
You could easily do this on emulator, run your app, and then click double arrow button which pops up another window, and then go to screenshot tab and capture. Or if you have device press Widnows Home and Power simmontaniously.
You can take a screenshot using your Emulator.
When you run your app on Emulator you can see a double arrow button
right side of the Emulator.
Click on that double arrow button, which ll show another window right
side of the Emulator.
And Tap on the screenshot tab and capture the screenshot.
You can save the screenshot to your local machine.
I'm creating a seemingly simple dojo 1.8 web page which contains an app layout div containing a tab container and an alarm panel below the tab container. They are separated by a splitter so the user can select how much of the alarms or the tabcontainer they want to see.
Here's the example on jsfiddle:
http://jsfiddle.net/bfW7u/
For the purpose of the demo, there's a timer which grows the table in the alarm panel by an entry every 2 seconds.
The problem(s):
If one doesn't do anything and just lets the table grow, no scroll bar appears in the alarm panel.
If one moves the splitter without having resized the browser window first, the splitter handle ends up in a weird location.
Resizing the browser window makes it behave like I would expect it to begin with.
Questions:
Am I doing something wrong in the way I'm setting things up and that's causing this problem?
How can I catch the splitter has been moved event (name?)
How do I resize the splitter pane to an arbitrary height? I've tried using domStyle.set("alarmPanel", "height", 300) and this indeed sets the height property... but the pane does not resize!
Any help greatly appreciated!
I forked your jsFiddle and made some modifications to it: http://jsfiddle.net/phusick/f7qL6/
Get rid of overflow: hidden in html, body and explicitly set height of alarmPanel:
.claro .demoLayout .edgePanel {
height: 150px;
}
This tricky one. You have two options: to listen to splitter's drag and drop or to listen to ContentPane.resize method invocation. Both via dojo/aspect:
// Drag and Drop
var splitter = registry.byId("appLayout").getSplitter("bottom");
var moveHandle = null;
aspect.after(splitter, "_startDrag", function() {
moveHandle = aspect.after(splitter.domNode, "onmousemove", function() {
var coords = {
x: !splitter.horizontal ? splitter.domNode.style.left : 0,
y: splitter.horizontal ? splitter.domNode.style.top : 0
}
dom.byId("dndOutput").textContent = JSON.stringify(coords);
})
});
aspect.after(splitter, "_stopDrag", function() {
moveHandle && moveHandle.remove();
});
// ContentPane.resize()
aspect.after(registry.byId("alarmPanel"), "resize", function(duno, size) {
dom.byId("resizeOutput").textContent = JSON.stringify(size);
});
Call layout() method after changing the size:
registry.byId("alarmPanel").domNode.style.height = "200px";
registry.byId("appLayout").layout();