mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 15:10:23 +00:00
Add double click option
This commit is contained in:
parent
20093becf3
commit
734fac9af6
7 changed files with 57 additions and 12 deletions
|
@ -103,14 +103,26 @@ public abstract class StoreEntryComp extends SimpleComp {
|
|||
});
|
||||
});
|
||||
button.addEventFilter(MouseEvent.MOUSE_CLICKED, event -> {
|
||||
if (event.getClickCount() > 1) {
|
||||
if (AppPrefs.get().requireDoubleClickForConnections().get()) {
|
||||
if (event.getButton() == MouseButton.PRIMARY && event.getClickCount() != 2) {
|
||||
event.consume();
|
||||
}
|
||||
} else {
|
||||
if (event.getButton() == MouseButton.PRIMARY && event.getClickCount() > 1) {
|
||||
event.consume();
|
||||
}
|
||||
}
|
||||
});
|
||||
button.addEventFilter(MouseEvent.MOUSE_PRESSED, event -> {
|
||||
if (event.getClickCount() > 1) {
|
||||
if (AppPrefs.get().requireDoubleClickForConnections().get()) {
|
||||
if (event.getButton() == MouseButton.PRIMARY && event.getClickCount() != 2) {
|
||||
event.consume();
|
||||
}
|
||||
} else {
|
||||
if (event.getButton() == MouseButton.PRIMARY && event.getClickCount() > 1) {
|
||||
event.consume();
|
||||
}
|
||||
}
|
||||
});
|
||||
new ContextMenuAugment<>(
|
||||
mouseEvent -> mouseEvent.getButton() == MouseButton.SECONDARY,
|
||||
|
|
|
@ -112,6 +112,13 @@ public class AppPrefs {
|
|||
final ObjectProperty<SupportedLocale> language =
|
||||
map(new SimpleObjectProperty<>(SupportedLocale.getEnglish()), "language", SupportedLocale.class);
|
||||
|
||||
final BooleanProperty requireDoubleClickForConnections =
|
||||
map(new SimpleBooleanProperty(false), "requireDoubleClickForConnections", Boolean.class);
|
||||
|
||||
public ObservableBooleanValue requireDoubleClickForConnections() {
|
||||
return requireDoubleClickForConnections;
|
||||
}
|
||||
|
||||
@Getter
|
||||
private final Property<InPlaceSecretValue> lockPassword = new SimpleObjectProperty<>();
|
||||
|
||||
|
@ -165,6 +172,7 @@ public class AppPrefs {
|
|||
new LocalShellCategory(),
|
||||
new SecurityCategory(),
|
||||
new HttpApiCategory(),
|
||||
new WorkflowCategory(),
|
||||
new TroubleshootCategory(),
|
||||
new DeveloperCategory())
|
||||
.filter(appPrefsCategory -> appPrefsCategory.show())
|
||||
|
|
|
@ -49,10 +49,6 @@ public class AppearanceCategory extends AppPrefsCategory {
|
|||
.addToggle(prefs.condenseConnectionDisplay)
|
||||
.nameAndDescription("showChildCategoriesInParentCategory")
|
||||
.addToggle(prefs.showChildCategoriesInParentCategory))
|
||||
.addTitle("workflow")
|
||||
.sub(new OptionsBuilder()
|
||||
.nameAndDescription("openConnectionSearchWindowOnConnectionCreation")
|
||||
.addToggle(prefs.openConnectionSearchWindowOnConnectionCreation))
|
||||
.addTitle("windowOptions")
|
||||
.sub(new OptionsBuilder()
|
||||
.nameAndDescription("windowOpacity")
|
||||
|
|
25
app/src/main/java/io/xpipe/app/prefs/WorkflowCategory.java
Normal file
25
app/src/main/java/io/xpipe/app/prefs/WorkflowCategory.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
package io.xpipe.app.prefs;
|
||||
|
||||
import io.xpipe.app.fxcomps.Comp;
|
||||
import io.xpipe.app.util.OptionsBuilder;
|
||||
|
||||
public class WorkflowCategory extends AppPrefsCategory {
|
||||
|
||||
@Override
|
||||
protected String getId() {
|
||||
return "workflow";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Comp<?> create() {
|
||||
var prefs = AppPrefs.get();
|
||||
return new OptionsBuilder()
|
||||
.addTitle("workflow")
|
||||
.sub(new OptionsBuilder()
|
||||
.nameAndDescription("openConnectionSearchWindowOnConnectionCreation")
|
||||
.addToggle(prefs.openConnectionSearchWindowOnConnectionCreation)
|
||||
.nameAndDescription("requireDoubleClickForConnections")
|
||||
.addToggle(prefs.requireDoubleClickForConnections))
|
||||
.buildComp();
|
||||
}
|
||||
}
|
|
@ -417,7 +417,7 @@ public class DataStoreEntry extends StorageElement {
|
|||
stateObj.set("persistentState", storePersistentStateNode);
|
||||
obj.set("configuration", mapper.valueToTree(configuration));
|
||||
stateObj.put("expanded", expanded);
|
||||
stateObj.put("orderBefore", explicitOrder != null ? explicitOrder.toString() : null);
|
||||
stateObj.set("order", mapper.valueToTree(explicitOrder));
|
||||
|
||||
var entryString = mapper.writeValueAsString(obj);
|
||||
var stateString = mapper.writeValueAsString(stateObj);
|
||||
|
|
|
@ -7,6 +7,8 @@ The XPipe beacon component is responsible for handling all communications betwee
|
|||
and the APIs and the CLI. It provides an API that supports all kinds
|
||||
of different operations.
|
||||
|
||||
For a full documentation, see the [OpenAPI spec](/../openapi.yaml)
|
||||
|
||||
### Inner Workings
|
||||
|
||||
- The underlying communication is realized through an HTTP server on port `21721`
|
||||
|
@ -17,14 +19,14 @@ of different operations.
|
|||
- Every exchange is initiated from the outside by sending a request message to the XPipe daemon.
|
||||
The daemon then always sends a response message.
|
||||
|
||||
- The body of a message is formatted in the json format.
|
||||
- The body of a message is usually formatted in the json format.
|
||||
As a result, all data structures exchanged must be serializable/deserializable with jackson.
|
||||
|
||||
## Configuration
|
||||
|
||||
#### Custom port
|
||||
|
||||
The default port can be changed by passing the property `io.xpipe.beacon.port=<port>` to the daemon or changing it in the settings menu.
|
||||
The default port can be changed by passing the property `io.xpipe.beacon.port=<port>` to the daemon.
|
||||
Note that if both sides do not have the same port setting, they won't be able to reach each other.
|
||||
|
||||
#### Custom launch command
|
||||
|
|
|
@ -477,3 +477,5 @@ areOnlySupportedLimit=are only supported with a professional license when having
|
|||
enabled=Enabled
|
||||
enableGitStoragePtbDisabled=Git synchronization is disabled for public test builds to prevent usage with regular release git repositories and to discourage using a PTB build as your daily driver.
|
||||
copyId=Copy ID
|
||||
requireDoubleClickForConnections=Require double click for connections
|
||||
requireDoubleClickForConnectionsDescription=If enabled, you have to double-click connections to launch them. This is useful if you're used to double-clicking things.
|
Loading…
Reference in a new issue