* Also show the tool tip in case there is no monitor info, but still info about
the device. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34660 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1179,45 +1179,46 @@ ScreenWindow::_UpdateMonitor()
|
|||||||
monitor_info info;
|
monitor_info info;
|
||||||
float diagonalInches;
|
float diagonalInches;
|
||||||
status_t status = fScreenMode.GetMonitorInfo(info, &diagonalInches);
|
status_t status = fScreenMode.GetMonitorInfo(info, &diagonalInches);
|
||||||
|
if (status == B_OK) {
|
||||||
|
char text[512];
|
||||||
|
snprintf(text, sizeof(text), "%s%s%s %g\"", info.vendor,
|
||||||
|
info.name[0] ? " " : "", info.name, diagonalInches);
|
||||||
|
|
||||||
if (status != B_OK) {
|
fMonitorInfo->SetText(text);
|
||||||
|
|
||||||
|
if (fMonitorInfo->IsHidden())
|
||||||
|
fMonitorInfo->Show();
|
||||||
|
} else {
|
||||||
if (!fMonitorInfo->IsHidden())
|
if (!fMonitorInfo->IsHidden())
|
||||||
fMonitorInfo->Hide();
|
fMonitorInfo->Hide();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char text[512];
|
char text[512];
|
||||||
snprintf(text, sizeof(text), "%s%s%s %g\"", info.vendor,
|
|
||||||
info.name[0] ? " " : "", info.name, diagonalInches);
|
|
||||||
|
|
||||||
fMonitorInfo->SetText(text);
|
|
||||||
|
|
||||||
if (fMonitorInfo->IsHidden())
|
|
||||||
fMonitorInfo->Show();
|
|
||||||
|
|
||||||
size_t length = 0;
|
size_t length = 0;
|
||||||
text[0] = 0;
|
text[0] = 0;
|
||||||
|
|
||||||
if (info.min_horizontal_frequency != 0
|
if (status == B_OK) {
|
||||||
&& info.min_vertical_frequency != 0
|
if (info.min_horizontal_frequency != 0
|
||||||
&& info.max_pixel_clock != 0) {
|
&& info.min_vertical_frequency != 0
|
||||||
length = snprintf(text, sizeof(text),
|
&& info.max_pixel_clock != 0) {
|
||||||
"Horizonal Frequency:\t%lu - %lu kHz\n"
|
length = snprintf(text, sizeof(text),
|
||||||
"Vertical Frequency:\t%lu - %lu Hz\n\n"
|
"Horizonal Frequency:\t%lu - %lu kHz\n"
|
||||||
"Maximum Pixel Clock:\t%g MHz",
|
"Vertical Frequency:\t%lu - %lu Hz\n\n"
|
||||||
info.min_horizontal_frequency, info.max_horizontal_frequency,
|
"Maximum Pixel Clock:\t%g MHz",
|
||||||
info.min_vertical_frequency, info.max_vertical_frequency,
|
info.min_horizontal_frequency, info.max_horizontal_frequency,
|
||||||
info.max_pixel_clock / 1000.0);
|
info.min_vertical_frequency, info.max_vertical_frequency,
|
||||||
}
|
info.max_pixel_clock / 1000.0);
|
||||||
if (info.serial_number[0] && length < sizeof(text)) {
|
}
|
||||||
length += snprintf(text + length, sizeof(text) - length,
|
if (info.serial_number[0] && length < sizeof(text)) {
|
||||||
"%sSerial no.: %s", length ? "\n\n" : "",
|
|
||||||
info.serial_number);
|
|
||||||
if (info.produced.week != 0 && info.produced.year != 0
|
|
||||||
&& length < sizeof(text)) {
|
|
||||||
length += snprintf(text + length, sizeof(text) - length,
|
length += snprintf(text + length, sizeof(text) - length,
|
||||||
" (%u/%u)", info.produced.week, info.produced.year);
|
"%sSerial no.: %s", length ? "\n\n" : "",
|
||||||
}
|
info.serial_number);
|
||||||
|
if (info.produced.week != 0 && info.produced.year != 0
|
||||||
|
&& length < sizeof(text)) {
|
||||||
|
length += snprintf(text + length, sizeof(text) - length,
|
||||||
|
" (%u/%u)", info.produced.week, info.produced.year);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add info about the graphics device
|
// Add info about the graphics device
|
||||||
|
|||||||
Reference in New Issue
Block a user