mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-22 22:58:34 +00:00
maximum_width
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@160 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
9c56581089
commit
327e723e8e
@ -1,5 +1,8 @@
|
||||
# $Id$
|
||||
|
||||
2005-08-23
|
||||
* Added maximum_width
|
||||
|
||||
2005-08-22
|
||||
* Added $execibar and $execigraph
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
<mainprogram>conky</mainprogram>
|
||||
<directoryradio>build</directoryradio>
|
||||
<customdirectory>/</customdirectory>
|
||||
<programargs></programargs>
|
||||
<programargs/>
|
||||
<terminal>false</terminal>
|
||||
<autocompile>true</autocompile>
|
||||
<envvars/>
|
||||
@ -55,14 +55,14 @@
|
||||
<f77compiler>kdevpgf77options</f77compiler>
|
||||
<cflags>-O2 -Wall -fexceptions -fomit-frame-pointer -fshort-enums -ggdb</cflags>
|
||||
<envvars/>
|
||||
<topsourcedir></topsourcedir>
|
||||
<cppflags></cppflags>
|
||||
<ldflags></ldflags>
|
||||
<ccompilerbinary></ccompilerbinary>
|
||||
<cxxcompilerbinary></cxxcompilerbinary>
|
||||
<f77compilerbinary></f77compilerbinary>
|
||||
<cxxflags></cxxflags>
|
||||
<f77flags></f77flags>
|
||||
<topsourcedir/>
|
||||
<cppflags/>
|
||||
<ldflags/>
|
||||
<ccompilerbinary/>
|
||||
<cxxcompilerbinary/>
|
||||
<f77compilerbinary/>
|
||||
<cxxflags/>
|
||||
<f77flags/>
|
||||
</debug>
|
||||
<debug-no-x>
|
||||
<envvars/>
|
||||
|
6
README
6
README
@ -197,7 +197,11 @@ CONFIGURATION SETTINGS
|
||||
Mail spool for mail checking
|
||||
|
||||
|
||||
minimum_size
|
||||
maximum_width pixels
|
||||
Maximum width of window
|
||||
|
||||
|
||||
minimum_size width (height)
|
||||
Minimum size of window
|
||||
|
||||
|
||||
|
@ -126,7 +126,18 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><command><option>minimum_size</option></command></term>
|
||||
<term><command><option>maximum_width</option></command>
|
||||
<option>pixels</option>
|
||||
</term>
|
||||
<listitem>
|
||||
Maximum width of window
|
||||
<para></para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><command><option>minimum_size</option></command>
|
||||
<option>width (height)</option>
|
||||
</term>
|
||||
<listitem>
|
||||
Minimum size of window
|
||||
<para></para></listitem>
|
||||
|
136
src/config.h.in
136
src/config.h.in
@ -1,136 +0,0 @@
|
||||
/* src/config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Define if you are using Cairo */
|
||||
#undef CAIRO
|
||||
|
||||
/* Define if you want support for the DBE extension */
|
||||
#undef DOUBLE_BUFFER
|
||||
|
||||
/* Define to 1 if you have the <cairo.h> header file. */
|
||||
#undef HAVE_CAIRO_H
|
||||
|
||||
/* Define to 1 if you have the <cairo-xlib.h> header file. */
|
||||
#undef HAVE_CAIRO_XLIB_H
|
||||
|
||||
/* Define to 1 if you have the <dirent.h> header file. */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define if you have getloadavg */
|
||||
#undef HAVE_GETLOADAVG
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if you have kstat (Solaris) */
|
||||
#undef HAVE_KSTAT
|
||||
|
||||
/* Define to 1 if you have the <linux/soundcard.h> header file. */
|
||||
#undef HAVE_LINUX_SOUNDCARD_H
|
||||
|
||||
/* Define to 1 if you have the <mcheck.h> header file. */
|
||||
#undef HAVE_MCHECK_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `popen' function. */
|
||||
#undef HAVE_POPEN
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#undef HAVE_SIGNAL_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have sysinfo (Linux) */
|
||||
#undef HAVE_SYSINFO
|
||||
|
||||
/* Define to 1 if you have the <sys/mount.h> header file. */
|
||||
#undef HAVE_SYS_MOUNT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define to 1 if you have the <sys/statfs.h> header file. */
|
||||
#undef HAVE_SYS_STATFS_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <sys/utsname.h> header file. */
|
||||
#undef HAVE_SYS_UTSNAME_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have X11 */
|
||||
#undef HAVE_X11
|
||||
|
||||
/* Define to 1 if you have the <X11/Xlib.h> header file. */
|
||||
#undef HAVE_X11_XLIB_H
|
||||
|
||||
/* Xdbe */
|
||||
#undef HAVE_XDBE
|
||||
|
||||
/* Define if you want MLDonkey support */
|
||||
#undef MLDONKEY
|
||||
|
||||
/* Define if you want MPD support */
|
||||
#undef MPD
|
||||
|
||||
/* Define if you want support for window creating */
|
||||
#undef OWN_WINDOW
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define if you want to use /proc/uptime for uptime */
|
||||
#undef PROC_UPTIME
|
||||
|
||||
/* Define if you want SETI at Home stats */
|
||||
#undef SETI
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define if you want to use X11 */
|
||||
#undef X11
|
||||
|
||||
/* Define if you are using Xft */
|
||||
#undef XFT
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
#undef X_DISPLAY_MISSING
|
27
src/conky.c
27
src/conky.c
@ -239,6 +239,7 @@ static int fixed_size = 0, fixed_pos = 0;
|
||||
#endif
|
||||
|
||||
static int minimum_width, minimum_height;
|
||||
static int maximum_width;
|
||||
|
||||
/* UTF-8 */
|
||||
int utf8_mode = 0;
|
||||
@ -2658,6 +2659,8 @@ static void text_size_updater(char *s)
|
||||
w += get_string_width(s);
|
||||
if (w > text_width)
|
||||
text_width = w;
|
||||
if (text_width > maximum_width && maximum_width)
|
||||
text_width = maximum_width;
|
||||
|
||||
text_height += h;
|
||||
if (fontchange) {
|
||||
@ -2684,6 +2687,8 @@ static void update_text_area()
|
||||
text_width += 1;
|
||||
if (text_height < minimum_height)
|
||||
text_height = minimum_height;
|
||||
if (text_width > maximum_width && maximum_width > 0)
|
||||
text_width = maximum_width;
|
||||
}
|
||||
|
||||
/* get text position on workarea */
|
||||
@ -2804,6 +2809,12 @@ static void draw_string(const char *s)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (text_width == maximum_width) {
|
||||
/* this means the text is probably pushing the limit, so we'll chop it */
|
||||
while (cur_x + get_string_width(tmpstring2) - text_start_x > maximum_width && strlen(tmpstring2) > 0) {
|
||||
tmpstring2[strlen(tmpstring2)-1] = '\0';
|
||||
}
|
||||
}
|
||||
s = tmpstring2;
|
||||
#ifdef X11
|
||||
#ifdef XFT
|
||||
@ -3021,6 +3032,9 @@ static void draw_line(char *s)
|
||||
|
||||
case BAR:
|
||||
{
|
||||
if (cur_x > maximum_width - text_start_x) {
|
||||
break;
|
||||
}
|
||||
int h =
|
||||
specials[special_index].height;
|
||||
int bar_usage =
|
||||
@ -3064,6 +3078,9 @@ static void draw_line(char *s)
|
||||
|
||||
case GRAPH:
|
||||
{
|
||||
if (cur_x > maximum_width - text_start_x && maximum_width > 0) {
|
||||
break;
|
||||
}
|
||||
int h =
|
||||
specials[special_index].height;
|
||||
int by;
|
||||
@ -3508,6 +3525,8 @@ static void main_loop()
|
||||
text_height =
|
||||
window.height -
|
||||
border_margin * 2 - 1;
|
||||
if (text_width > maximum_width && maximum_width > 0)
|
||||
text_width = maximum_width;
|
||||
}
|
||||
|
||||
/* if position isn't what expected, set fixed pos, total_updates
|
||||
@ -3701,6 +3720,7 @@ static void set_default_configurations(void)
|
||||
gap_y = 5;
|
||||
minimum_width = 5;
|
||||
minimum_height = 5;
|
||||
maximum_width = 0;
|
||||
#ifdef OWN_WINDOW
|
||||
own_window = 0;
|
||||
#endif
|
||||
@ -4006,6 +4026,13 @@ else if (strcasecmp(name, a) == 0 || strcasecmp(name, a) == 0)
|
||||
} else
|
||||
CONF_ERR;
|
||||
}
|
||||
CONF("maximum_width") {
|
||||
if (value) {
|
||||
if (sscanf(value, "%d", &maximum_width) != 1)
|
||||
CONF_ERR;
|
||||
} else
|
||||
CONF_ERR;
|
||||
}
|
||||
#endif /* X11 */
|
||||
CONF("no_buffers") {
|
||||
no_buffers = string_to_bool(value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user