I want to get Fig Autocomplete working with xmonad. The autocomplete window should be positioned by the terminal cursor. This happens with other window managers, but under xmonad, it is not able to position itself.
Here is my configuration for doing this:
myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet)
myManageHook = composeAll
[ className =? "confirm" --> doFloat
, className =? "Fig" --> doIgnore -- Fig
] <+> namedScratchpadManageHook myScratchPads
How can I configure xmonad to allow it to reposition itself freely?
Related
I set the title of my window upon creation and update it as needed depending on the user actions.
However, when using the history navigation function goBack and goForward (via react-router-dom useNavigate) the window's title is updated automatically and takes the value of the title defined in the HTML file loaded by the window. Since I don't have any title defined in my HTML file, it just makes the title disappear.
const appWindow = new BrowserWindow({
title: app.name,
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
enableRemoteModule: false,
preload: path.join(__dirname, "../preloads/app.js")
}
});
appWindow.loadURL(getWindowUrl("index"));
Is there a way to disable this behaviour so the title doesn't update?
I'm using electron version 17.1.0 and react-router-dom 6.2.1.
Electron's BrowserWindow class has the "page-title-updated" event which has the capability to cancel the update of the native window's title. For example,
window.on ("page-title-updated", (event, title, explicitSet) => {
e.preventDefault ();
});
This will cancel any window title update which originated from within the window's document. Note that you could check for a specific title using the title parameter, so as to disallow only some window titles.
As per the documentation linked above, in case the title was created by making the document's URL the window title, explicitSet will be false.
Note that this will not trigger when you set the window title using Electron's API.
I'm using Angular 10, on click the following function is executed to preform direction change:
private changeHtmlDirection(direction: 'rtl' | 'ltr') {
document.getElementsByTagName("html")[0].dir = direction;
}
It works well, only that the Angular CDK does not update.
I tried to find an API to change Angular CDK's direction at runtime, but couldn't find any.
I saw that there's a BidiModule but it uses only to get the current direction rather than set it.
Is there any solution?
According to the material documentation, you can't change 'dir' on the "html" tag so that affects bidi API. You can see the document at the following link:
bi-directionality document
But if you want to use material bi-directionality you can add the 'dir' directive to a container element in the root component like bellow:
<div [dir]="documentDirection"> </div>
and whenever the 'documentDirection' variable changes, the bidi "change emitter" will be emit.
like following code you can subscribe to it:
constructor(
private dir: Directionality ) {
this.isRtl = dir.value === 'rtl';
this.dir.change.subscribe(() => {
this.isRtl = !this.isRtl;
});
}
I'm using the Forge Viewer to display properties on selected items in my model.
When an object is selected, I want to automatically show the properties panel but keep a category collapsed. Here's the code I'm using in an attempt to achieve this:
viewer.addEventListener(
Autodesk.Viewing.SELECTION_CHANGED_EVENT,
() => {
const panel = viewer.getPropertyPanel();
panel.setVisible(true);
panel.setCategoryCollapsed("Category Name", true);
},
);
The event is raised and the panel is shown, however, the function setCategoryCollapsed does not work (understandable as it was last documented in v5). Is there a similar function in v7 to collapse a category?
That function expects an object with name and type properties - e.g. if I wanted to collapse the "Graphics" category, I could do it like this:
const panel = viewer.getPropertyPanel();
panel.setVisible(true);
panel.setCategoryCollapsed({name: "Graphics", type: "category"}, true);
Have also just written a blog post about it now: Collapse category in the Property Panel
I want to add a logo to the browser window in the same way as all browser windows are usually displayed:
titlePanel allows to add easily images to the application title, by using:
titlePanel(title = div(img(src="myAppImage.jpg"), "My App Name")
It is also possible to add the title that should be displayed by the browser window with windowTitle as a parameter.
However, it does not work when adding an image to the browser window. I tried:
titlePanel(title = div(img(src="myAppImage.jpg"), "My App Name"), windowTitle = div(img(src="myBrowserImage.png"), "My Browser Name")). But this gives the following browser name: <img src ...>
What is the correct way of writing it?
Not inside the titlePanel but you can add following inside the ui:
tags$head(
tags$link(rel = "icon", type = "image/png", sizes = "32x32", href = "/myBrowserImage.png"))
Also you should put the image inside www folder.
As #phago29 indicated, one way to write it is:
useShinyjs(),
## Window title
tags$head(
tags$link(rel = "icon", type = "image/png", sizes = "32x32", href = "myBrowserImage.png")),
# App title ----
titlePanel( title = div(img(src="myAppImage.png"), 'myAppTitle'), windowTitle = "myBrowserTitle" ),
# Rest of the UI
)
With the png images in a subfolder called "www".
I'm writing a Single-Page Application in Elm. After the page is rendered, I need to modify some element's properties by some event.
For example, let's say I have a div with a set of classes assigned to it, and now I want to toggle its classList when a button on the page is pressed. How can I do that using just native Elm constructions?
I know that such goal can be achieved by using 'old good' JavaScript plus Elm ports, but is there a way for doing that by using just Elm with no 'external' JavaScript and Elm ports?
updated after some comments
all the page is rendered and constructed by Elm, no 'external' JavaScript code;
I would like to update just the HTML element, without re-rendering all the page.
You can construct your view function return
div with appropriate classes depending on your model.
Following example, div gets class "black" when model
is 1. No classes attached to the div otherwise.
And click event updates the model.
-- UPDATE
type Msg
= ToggleColor
update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
case msg of
ToggleColor -> (if model == 0 then 1 else 0, Cmd.none)
-- VIEW
view : Model -> Html Msg
view model =
let
classAttributes = classList [("black", model == 1)]
in div [ classAttributes, onClick ToggleColor ] [ text "test" ]