Comments (5)
HI Mate
I have re positioned the image so that its on a new line after the title and above the message,
set the image max-height to (* 4 (line-pixel-height)) so you can see the icon
and also set the image to be hidden by default in the ednc-log view
heres the code i re jigged
not sure if thats the best way to do it, but it works
`
;; notification - reposition image
(defun ednc-format-notification (notification &optional expand-flag)
"Return propertized description of NOTIFICATION.
If EXPAND-FLAG is nil, make details invisible by default."
(let* ((hints (ednc-notification-hints notification))
(urgency (or (ednc--get-hint hints "urgency") 1))
(inherit (if (<= urgency 0) 'shadow (when (>= urgency 2) 'bold))))
(format (propertize "* %s: %s \n%s %s" 'face (list :inherit inherit)
'ednc-notification notification)
(ednc-notification-app-name notification)
(ednc--format-summary notification)
(propertize (concat "\n" (alist-get 'icon (ednc-notification-amendments notification) "\n"))
'invisible (not expand-flag))
(propertize (concat "\n" (ednc-notification-body notification) "\n")
'invisible (not expand-flag)))))
;; image size = * 4 line pixel height
(defun ednc--amend-icon (new)
"Set icon string created from NEW notification.
This function modifies the notification's hints."
(catch 'invalid
(let* ((hints (ednc-notification-hints new))
(image
(or (ednc--data-to-image (ednc--get-hint hints "image-data" t))
(ednc--path-to-image (ednc--get-hint hints "image-path"))
(ednc--path-to-image (ednc-notification-app-icon new))
(ednc--data-to-image (ednc--get-hint hints "icon_data" t)))))
(when image
(setf (image-property image :max-height) (* 4 (line-pixel-height))
(image-property image :ascent) 90)
(push (cons 'icon (propertize " " 'display image))
(ednc-notification-amendments new))))))
`
ednc pop up window
ednc log collapsed
ednc log expaned
if the notification doesnt have an icon there are 4 lines of empty space above the message
where the icon would be
so i need to figure out a way to fix that issue
from ednc.
Thanks for the suggestion. Unfortunately, I can't adopt it as it is: the main problem is that ednc-format-notification
is also the suggested way to format notifications to be shown in the mode line, so all the important information has to fit in a single line of normal height. (Incidentally, that's also the reason why adding timestamps or even just bullet points isn't trivial: screen estate is at a premium in the mode line, but there's no way for ednc-format-notification
to tell where its output is headed.)
My current plan is to make icons expandable to their original size, but I need some more time to experiment.
from ednc.
i can see how that layout wouldnt fit in the mode line, no problem
just me blundering about hacking the code,
going for a dunst style layout
i need to work out how to remove the extra lines if theres no image,
no sure how to do that yet,
and create a pop up frame thats overrides the following settings to open small frame
`
;; start the initial frame maximized
(add-to-list 'initial-frame-alist '(fullscreen . maximized))
;; start every frame maximized
(add-to-list 'default-frame-alist '(fullscreen . maximized))
`
feel free to delete these comments
from ednc.
@NapoleonWils0n, you should now be able to scale icons by mouse wheel scrolling while pointing to them and keeping Ctrl pressed. Hope this helps in cases like yours, where icons are detailed images.
(I will keep this issue open regardless: like #7, it's general enough to include XML elements in the future.)
from ednc.
i just updated to the latest version of ednc
and can confirm that holding ctrl and scrolling increases the image size
ill do another video and mention the updates you made
including the image scrolling and the open with fix using mm-util
(require 'mm-util) (add-to-list 'mm-inhibit-file-name-handlers 'openwith-file-handler)
let me know if theres anything else i should cover or mention in the next video
great work, ednc is much better than gnomes built in notifications
which in my opinion is more like a designers mock up with truncated messages you can read or expand
from ednc.
Related Issues (11)
- FYI: if-let, when-let, pcase-let HOT 9
- Feature requests HOT 2
- would calling something like herbe/wayherb still be possible with an hook with ednc? HOT 3
- general experience, ideas, and thank you HOT 1
- Screenshots HOT 4
- ednc--get-hint errors out on valid association list HOT 4
- ednc-dismiss-notification key binding not working for me HOT 4
- Displaying new notifications in new frames is undocumented
- Support for embedded URLs could be better HOT 1
- Interference by `openwith.el` HOT 5
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 ednc.