I’d like to use mdpopups for a plugin I’m writing. Does anybody have some practice with it? What I’d like to do is a box that spans for the view width, at the bottom or at the top, which would contain file information when the view is changed or when the tooltip is called. I can make a tooltip appear, but it’s not big enough, I can set max_width but not the minimum width. Also, I would like to keep a consistent colour, independent from the colour scheme, because this makes it just harder to read or even notice. Any suggestions? Thanks if you can provide any.
Mdpopups, how to make a view-wide popup
Popups don’t support min width and even positioning might be tricky.
If you want to show a view at the bottom, why don’t you use a panel. You can add phantom text to it, which supports html for better formatting. You could also use normal css to modify the look.
Thanks, seems like phantoms could be the best options. Also the output panel wouldn’t be bad, maybe I’ll try both.
Is there a way to set an image as background for a popup/phantom, to be stretched? Thanks
The minihtml reference doesn’t mention the CSS property that would do this, although having said that I am by no means an HTML/CSS wizard so there may be some other way to do the same thing.
Thanks all for the answers. I’m struggling trying to create the output panel. For now I have:
class FilePanelCommand(sublime_plugin.TextCommand):
def run(self, edit, content, css):
def scheme():
return settings().get("file_panel_color_scheme")
output = win().create_output_panel("file_operations")
output.settings().set("color_scheme", scheme())
output.insert(edit, output.size(), content + '\n')
output.set_read_only(True)
win().run_command("show_panel", {"panel": "output.file_operations"})
The panel shows up, but empty. How is it that I can insert text in the panel? Thanks
Edit: ok I sorted it out with set_read_only(False)
put before insert