mirror of
https://github.com/davatorium/rofi.git
synced 2025-03-31 17:25:40 -04:00
[Widget] Add 2 workaround for error in corner radius drawing
* Disable AA (works on nvidia) * Disable nvidia workaround.
This commit is contained in:
parent
d948e33e68
commit
f0ccf4c186
3 changed files with 26 additions and 5 deletions
|
@ -964,6 +964,11 @@ The following properties are currently supported:
|
|||
|
||||
- **border-radius**: padding
|
||||
Sets a radius on the corners of the borders.
|
||||
- border-aa: boolean
|
||||
Disable aliasing on the border line. Disabling fixes some drawing issues because of nvidia broken driver workaround.
|
||||
|
||||
- border-disable-nvidia-workaround: boolean
|
||||
Disable work-around for nvidia driver breaking.
|
||||
|
||||
- **background-color**: color
|
||||
Background color
|
||||
|
@ -985,10 +990,10 @@ The following properties are currently supported:
|
|||
|
||||
- **transparency**: string
|
||||
Indicating if transparency should be used and what type:
|
||||
- **real** - True transparency. Only works with a compositor.
|
||||
- **background** - Take a screenshot of the background image and use that.
|
||||
- **screenshot** - Take a screenshot of the screen and use that.
|
||||
- **Path** to png file - Use an image.
|
||||
- **real** - True transparency. Only works with a compositor.
|
||||
- **background** - Take a screenshot of the background image and use that.
|
||||
- **screenshot** - Take a screenshot of the screen and use that.
|
||||
- **Path** to png file - Use an image.
|
||||
|
||||
- **location**: position
|
||||
The place of the anchor on the monitor
|
||||
|
|
|
@ -83,6 +83,12 @@ struct _widget {
|
|||
gboolean expand;
|
||||
/** Place widget at end of parent */
|
||||
gboolean end;
|
||||
|
||||
/** enable/disable border aliasing. */
|
||||
gboolean border_antialiasing;
|
||||
/** enable/disable nvisia workaround. */
|
||||
gboolean border_disable_nvidia_workaround;
|
||||
|
||||
/** Parent widget */
|
||||
struct _widget *parent;
|
||||
/** Internal */
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
#include "cairo.h"
|
||||
#include "config.h"
|
||||
|
||||
#include "theme.h"
|
||||
|
@ -53,6 +54,10 @@ void widget_init(widget *wid, widget *parent, WidgetType type,
|
|||
|
||||
// enabled by default
|
||||
wid->enabled = rofi_theme_get_boolean(wid, "enabled", TRUE);
|
||||
|
||||
wid->border_antialiasing = rofi_theme_get_boolean(wid, "border-aa", TRUE);
|
||||
wid->border_disable_nvidia_workaround =
|
||||
rofi_theme_get_boolean(wid, "border-disable-nvidia-workaround", FALSE);
|
||||
}
|
||||
|
||||
void widget_set_state(widget *wid, const char *state) {
|
||||
|
@ -251,7 +256,12 @@ void widget_draw(widget *wid, cairo_t *d) {
|
|||
|
||||
if (left != 0 || top != 0 || right != 0 || bottom != 0) {
|
||||
cairo_save(d);
|
||||
// cairo_set_operator(d, CAIRO_OPERATOR_ADD);
|
||||
if (wid->border_antialiasing == FALSE) {
|
||||
cairo_set_antialias(d, CAIRO_ANTIALIAS_NONE);
|
||||
}
|
||||
if (wid->border_disable_nvidia_workaround) {
|
||||
cairo_set_operator(d, CAIRO_OPERATOR_ADD);
|
||||
}
|
||||
cairo_translate(d, wid->x, wid->y);
|
||||
cairo_new_path(d);
|
||||
rofi_theme_get_color(wid, "border-color", d);
|
||||
|
|
Loading…
Add table
Reference in a new issue